Top "Datetime" questions

A DateTime object in many programming languages describes a date and a time of day.

Adding one day to a date

My code to add one day to a date returns a date before day adding: 2009-09-30 20:24:00 date after adding …

php date datetime
How to get first and last day of previous month (with timestamp) in SQL Server

I could not find the solution which gives first and last day of previous month with timestamp. Hope this helps …

sql-server datetime
How to format a DateTime in PowerShell

I can format the Get-Date cmdlet no problem like this: $date = Get-Date -format "yyyyMMdd" But once I've got a date …

datetime powershell
Creating a range of dates in Python

I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, …

python datetime date
Get integer value of the current year in Java

I need to determine the current year in Java as an integer. I could just use java.util.Date(), but …

java datetime date
Showing Difference between two datetime values in hours

I am retrieving two date time values from the database. Once the value is retrieved, I need the difference between …

c# asp.net-mvc-2 datetime timespan
Convert string date to timestamp in Python

How to convert a string in the format "%d/%m/%Y" to timestamp? "01/12/2011" -> 1322697600

python datetime
How do you display JavaScript datetime in 12 hour AM/PM format?

How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?

javascript datetime date time format
Compare given date with today

I have following $var = "2010-01-21 00:00:00.0" I'd like to compare this date against today's date (i.e. I'd like to …

php date datetime
How to convert local time string to UTC?

How do I convert a datetime string in local time to a string in UTC time? I'm sure I've done …

python datetime utc localtime