Questions tagged as 'date'

2
answers

How do I convert a date into the American format in Angular?

I am using a Json answer in Laravel 5, where I use the Angular to be able to display this data. The date in Laravel is returned in 2017-05-17 15:56:46 format. When attempting to use the date filter on the angle, the same thing c...
asked by 18.05.2017 / 14:35
1
answer

Detect the last day of the month

At the beginning of the month I always need to calculate the age of the people within a given database. I always do considering the last date of that month, for example: in September I calculated the age using September 30th as a reference, so e...
asked by 17.10.2017 / 14:48
1
answer

Comparison of PHP schedules

date_default_timezone_set ( "America/Sao_Paulo" ); $dtz = new DateTimeZone('America/Sao_Paulo'); $dt = new DateTime('now', $dtz); $offset = $dtz->getOffset( $dt ) / 3600; $por_do_sol = date_sunset(time(), SUNFUNCS_RET_STRING, -20.7965404, -49....
asked by 23.02.2015 / 21:37
1
answer

String for Date

I'm creating some parsers and was doing tests to develop Date. This code: value = '2015-12-31 23:16:00' value = value.replace(/(\d{4}-\d{2}-\d{2}) ?(\d{2}:\d{2})?(:\d{2})?.*/, '$1T$2$3'); value = value.replace(/T$/, ''); value = valu...
asked by 01.07.2015 / 20:07
3
answers

Change a date from yyyy-MM-dd to dd-mm-yyyy

I have dataTable where I display some data but the date is coming in yyyy-mm-dd format how do I change the format of this date so that I can display it correctly in my dataTable ? And where do I do this formatting? In Bean or...
asked by 14.07.2015 / 14:03
3
answers

When should I use new?

What happens here? Why an instance of Date is created in this example: String dataFormatada = new Date().format("dd/MM/yyyy") In this example we did not use new : def data = Date.parse('dd/MM/yyyy', '31/12/1980') When shou...
asked by 16.12.2015 / 12:52
4
answers

Convert Field Data Date to Month Mysql

In a DB table I have a Data Field (0000-00-00) and I need to do the following: Create a field next to 'Month' that takes the date Ex: 2014-08-27 and pass the 'August' value to the month field. And so on with all the records in the Data field. Ho...
asked by 27.08.2014 / 14:12
1
answer

The function to get the day of the week of PHP has limit?

I'm making a calendar using PHP and JS and it worked perfectly between the year 1902 until 2037, because from 2038 the function to get the day of the week in PHP returns an incorrect value. Is there any specific reason for this? Follow the co...
asked by 09.07.2018 / 04:41
1
answer

Comparison between dates

I'm trying to validate the inclusion of dates in my system, referring to the batch of products, but I think I'm a bit hasty in the way I'm doing. For what I need, I thought of 3 situations that I should control, which would be them:    The...
asked by 02.09.2017 / 18:53
3
answers

How to get the last days of the month in PHP

I want to get the last months of the month from today's date. Here is the code for today's date: $datee= date("d/m/Y");     
asked by 29.10.2014 / 23:27