How-to articles, tricks, and solutions about DATE

java.util.Date to XMLGregorianCalendar

To convert a java.util.Date object to an XMLGregorianCalendar in Java, you can use the toGregorianCalendar method of the DatatypeFactory class.

PHP How to find the time elapsed since a date time?

You can use the DateTime class in PHP to find the time elapsed since a specific date time.

PHP subtract 1 month from date formatted with date ('m-Y')

You can use the DateTime object in PHP to subtract one month from a date formatted with date('m-Y').

Select records from today, this week, this month php mysql

To select records from today, you can use the following code:

Sort ArrayList of custom Objects by property

To sort an ArrayList of custom objects by a property, you can use the Collections.sort method and pass it a custom Comparator.

What is this date format? 2011-08-12T20:17:46.384Z

The date format "2011-08-12T20:17:46.384Z" is an ISO 8601 extended format, which is often used for exchanging date and time information in a machine-readable format.

Why is subtracting these two times (in 1927) giving a strange result?

Without more context, it is difficult to say why subtracting two times would give a strange result. Here are a few potential explanations:

1 2 3