Questions tagged as 'datetime'

5
answers

How to calculate the date and code of the shift?

I have a table that specifies the start time of a work shift and its duration in minutes: codigo descricao inicio(datetime) duracao(int) S01 PRIMEIRO 1900-01-01 05:00:00.000 540 S02 SEGUNDO...
asked by 27.10.2017 / 18:56
1
answer

Error trying to convert Portuguese date into datetime

I have a problem and I can not find a solution to fix it. I have a date in this format: Wednesday, April 30, 2014 and I want to save this date in the database in type datetime . So I am trying to convert to type datetime , but I h...
asked by 30.04.2014 / 17:50
5
answers

Should I check dates with DateTime or regex?

I've seen two different ways to check if a date is valid. In a "modern" way, with DateTime : $date="2014-02-04"; $dt = DateTime::createFromFormat("Y-m-d", $date); return $dt !== false && !array_sum($dt->getLastErrors());...
asked by 04.02.2014 / 19:42
4
answers

Convert month number to name

I need to convert the number of the month to the name of the same, but it has to be in Portuguese (and preferably without the need of substr ) I can do this, with the default language in English $monthNum = 3; $dateObj = DateTime::...
asked by 17.06.2014 / 15:57
3
answers

Get timestamp

I have two variables, one with the date and another with the time. How can I get your timestamp of the two variables. Example: var data = 02/01/2015; var hora = 10:00:00; var d = new Date(data + hora); d.getTime();     
asked by 06.01.2015 / 17:29
2
answers

How to subtract two dates using Python?

How do I know the difference of days between two dates using Python? For example, to know how many days there are between 11/22/213 and 3/25/2014 considering a possible leap year.     
asked by 29.01.2014 / 18:54
2
answers

calculate the difference between two dates in months in the R

How do I calculate the difference between two dates in months in R? Suppose both dates: x <- as.Date("2014-01-07") y <- as.Date("2015-03-17") I can easily calculate in seconds, minutes, hours, etc. using the difftime functio...
asked by 10.06.2015 / 22:23
5
answers

How to know the number of a week in each month

I'm working on ASP MVC4, and I would like to know how many weeks in a given month to generate a list with dates. For example, the user enters a week, and in that week of each month I generate a date. The user can enter the week of the month in w...
asked by 05.02.2014 / 10:59
3
answers

How to know the week of a given month?

I'm working on ASP.NET MVC 4, and I want to know what the week is for a given month. For example, the user wants to define a frequency of occurrences, and as such says: The occurrence will occur every%% weeks%; The occurrence will happe...
asked by 04.02.2014 / 16:35
3
answers

How to format date in Javascript by putting name of the month and day of the week

Hello. Home Have this date: 05/18/17 . Home And I need to convert it to this: May 18th (Thurs) Home May: May, (Thurs): Thursday Home Does anyone know how I do this using JavaScript and jQuery?     
asked by 16.05.2017 / 20:08