Questions tagged as 'date'

2
answers

Full return of Date type

How do I get this return? 2014-08-05 18: 29: 47.757 Using Date . Date data = new java.sql.Date(new java.util.Date().getTime()); Using this my return is only 2015-02-03 and does not return the hours. NOTE: I need to get...
asked by 03.02.2015 / 15:14
2
answers

How to convert string (in Portuguese) into date?

I have data.frame with a column (month) that represents the month and year of each remark that is in the form of a string. I would like to modify it to date so I can use the proc in excel with date. How can I do it? mes...
asked by 26.07.2017 / 16:31
2
answers

Delete files created more than 10 days ago, saving the most recent, if everyone on the list has more than 10 days of creation

I did this question where the question was how to delete files with more than 10 days of creation. I retrieve them from a directory and the code has already been implemented and is functional. However, I ended up with a problem that could c...
asked by 17.08.2016 / 20:31
2
answers

Format value with explode and PHP implode

I have a dhEmi tag that has this value 2016-09-09T08:10:52-03:00 To return a datetime I did the following. $dtemis = $item->infNFe->ide->dhEmi; $res = explode("T", $dtemis); $res1 = explode("-03:00", $res[1]); $array = arr...
asked by 09.09.2016 / 15:10
2
answers

Return day of the week from a date in the format dd / mm / yyy

I have this function that brings me the day of the week: public static String getWeek(String date){ //ex 07/03/2017 String dayWeek = "---"; GregorianCalendar gc = new GregorianCalendar(); try { gc.setTime(new SimpleDateForm...
asked by 07.03.2017 / 04:59
4
answers

Know what day falls next Monday

I need a schedule for an agenda that will give me the date of the next Mondays from a certain date Ex: today and day 06/01 I need to know what day the next 10 Mondays will fall. 1 = 05/06/2017 2 = 12/06/2017 3 = 19/06/2017 4 = 26/06/2017 5...
asked by 01.06.2017 / 18:44
2
answers

Wrong date calculation

I have the following method: TimeSpan dt = dataFinal.Subtract(dataInicial); double anos = Math.Floor(dt.Days / 365.25); double meses = Math.Floor(((dt.Days - anos * 365.25) / 30)); return string.Format("{0} Anos e {1} mês(es)", anos, meses);...
asked by 11.03.2015 / 15:38
1
answer

How to format the day of the week so that no symbol appears in PHP

How to change the symbol that appears on Tuesday by a Ç ? Mycodebelow:<?phpsetlocale(LC_ALL,"pt_BR", "pt_BR.utf-8", "portuguese" ); date_default_timezone_set('America/Sao_Paulo'); echo ucwords(strftime("%A ")); $dt = date...
asked by 22.08.2017 / 17:14
2
answers

How to call the previous month in R?

I need R to tell me the month before we are, that is, we are in "2018-05" and I need him to give me "2018-04". So far my solution was: format(Sys.Date()-as.integer(format(Sys.Date(), "%d")),"%Y-%m") I believe there should be a more "clean"...
asked by 11.06.2018 / 21:23
2
answers

Convert seconds to timestamp?

I am creating a PHP script to generate a json from a webvtt caption file, I get the start and end that are in the minuto:segundo.milisegundo format or if the video is too large they come as hora:minuto:segundo.milisegundo...
asked by 05.05.2017 / 00:14