Questions tagged [datetime]

A DateTime object in many programming languages describes a date and a time of day. It can express either an instant in time or a position on a calendar, depending on the context in which it is used and the specific implementation. This tag can be used for all date and time related issues.

A DateTime object in many programming languages describes a date and a time of day. It can express either an instant in time or a position on a calendar, depending on the context in which it is used and the specific implementation.

  • In , os.date and os.time are provided as part of lua's standard library for working with date and time.

  • In , datetime is a type that represents a date and time of day. It carries no time zone context, so it is a position on a calendar, not a moment in time.

  • In , DATETIME values represent a date and time of day. They carry no time zone context, so they are positions on a calendar, not an moment in time. TIMESTAMP values represent a moment in time, and are based on UNIX time. When MySQL stores TIMESTAMPs, it converts them from the current connection's time zone setting to UTC. When displaying them it converts them back.

  • In , DateTime is a structure that is typically expressed as a date and time of day. It represents either an instant in time, or a position on a calendar. The precise meaning is dependent on the value of its Kind property.

  • In , Instant is a class that represents an instant in time. Before Java 8 was a popular library, DateTime is a class which represents an instant in time, with reference to a particular time zone.

  • In , datetime is an object which represents a date and time of day. The precise meaning is dependent on the value of its tzinfo property. It is also the name of the module that provides date, time, datetime, and related objects.

  • In the DateTime class is a representation of a instant in time, with reference to a particular time zone.

  • In , the time and date manipulation library datetime-fortran can be used.

  • In , a Date instance represents a single moment in time. Date objects are based on a time value that is the number of milliseconds since 1 January, 1970 UTC. That is, they are UNIX time values in milliseconds.

  • In , the classes "POSIXlt" and "POSIXct" represent calendar dates and times.Subtraction of two date-time objects is equivalent to using difftime. Class "POSIXct" represents the (signed) number of seconds since the beginning of 1970 (in the UTC time zone) as a numeric vector. Class "POSIXlt" is a named list of vectors representing sec, min, hour et al

  • In , Microsoft Excel for Windows uses the 1900 date system, by default. Which means the first date is January 1, 1900. a Date and Time function can be used to manipulate the year/date and time/hour/minutes values. The date/time in Excel is stored as a number. Where the decimal part range from 0.0 to 0.99988426 represent 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.), and the integer part range from 0 to 9999 represent days. But Excel's date representation is slightly off in the first two months of calendar year 1900.

60897 questions
22
votes
7 answers

How to add 5 minutes to current datetime on php < 5.3

I want to add 5 minutes to this date: 2011-04-8 08:29:49 $date = '2011-04-8 08:29:49'; When I use strtotime I am always getting 1970-01-01 08:33:31 How do I add correctly 5 minutes to 2011-04-8 08:29:49?
beginner
  • 223
  • 1
  • 2
  • 4
22
votes
9 answers

Calculating daylight saving time from only date

I am working with an Arduino and a real time clock chip. The chip compensates for leap years and such, so it will always have the correct date, but it does not handle daylight saving time, I assume due to regional complications. The clock can give…
Muggz
  • 223
  • 1
  • 2
  • 5
22
votes
5 answers

Python time to age, part 2: timezones

Following on from my previous question, Python time to age, I have now come across a problem regarding the timezone, and it turns out that it's not always going to be "+0200". So when strptime tries to parse it as such, it throws up an exception. I…
Ashy
  • 1,893
  • 5
  • 20
  • 24
22
votes
1 answer

'No overload for method 'ToString' takes '1' arguments' error occur While Formatting Datetime Field To String ON "dd-MM-yyyy" format

I have been working on asp.net 3.5.I want to Convert a DateTime Data from sqldatareader to a String on "dd-MM-yyyy" Format. But when I use "dd-MM-yyyy" formatting parameter as "rdMonthlyLeave["LEAVE_DATE"].ToString("dd-MM-yyyy")" browser returns…
netraThapa
  • 379
  • 2
  • 3
  • 8
22
votes
3 answers

How to get last midnight in Dart?

I guess this is pretty common task in most languages, however it was not clear to me how to get this done in my Flutter app. How to retrieve DateTime object of the last midnight in Dart? Or potentially, any particular time today / tomorrow /…
Marek Lisý
  • 2,838
  • 2
  • 17
  • 27
22
votes
4 answers

Get Current System Time

How to get Current System's Time and Date without using Calender.getInstance()?
Niranj Patel
  • 35,286
  • 11
  • 96
  • 128
22
votes
3 answers

Working with timezones and daylight savings time in Javascript

My single-page javascript app retrieves data in JSON format via REST calls. Dates come formatted using the UTC timezone in standard ISO8601 format, such as 2011-02-04T19:31:09Z. When signing up for the service, users select their timezone from a…
Tauren
  • 25,387
  • 37
  • 126
  • 165
22
votes
4 answers

How to subtract dates with python

Today = today = datetime.datetime.now().strftime("%Y%m%d") 90days ago DD = datetime.timedelta(days=-90) How do I get today - DD, or 90days ago?
Merlin
  • 19,645
  • 34
  • 108
  • 190
22
votes
1 answer

How to convert DateTime::now() into NaiveDateTime?

I'm using Diesel and chrono. In my model I have a field of type NaiveDateTime which contains the now(). However, NaiveDateTime doesn't have the function now() or a similar one whereas DateTime does: Utc::now() How can I convert Utc::now() into…
Kurama
  • 257
  • 2
  • 5
22
votes
2 answers

Pandas filter dataframe rows with a specific year

I have a dataframe df and it has a Date column. I want to create two new data frames. One which contains all of the rows from df where the year equals some_year and another data frame which contains all of the rows of df where the year does not…
user3494047
  • 1,271
  • 3
  • 20
  • 47
22
votes
1 answer

Removing the timestamp from a datetime in pandas dataframe

Scenario: I have a dataframe with multiple columns retrieved from excel worksheets. Some of these columns are dates: some have just the date (yyyy:mm:dd) and some have date and timestamp (yyyy:mm:dd 00.00.000000). Question: How can I remove the time…
DGMS89
  • 1,301
  • 2
  • 21
  • 47
22
votes
6 answers

How do I check if a SQL Server datetime column is empty?

How do I check if a SQL Server datetime column is empty?
Vahid
  • 221
  • 1
  • 2
  • 3
22
votes
3 answers

Python - Calculate the difference between two datetime.time objects

I have two datetime.time objects and I want to calculate the difference in hours between them. For example a = datetime.time(22,00,00) b = datetime.time(18,00,00) I would like to be able to subtract these so that it gives me the value 4.
user3080600
  • 979
  • 2
  • 8
  • 19
22
votes
1 answer

Ecto/Elixir, How can I query by date?

I am working on statistics page of my app and trying to query data by date. To get the date range, I use Calendar.Date date_range = Date.days_after_until(start_date, end_date, true) |> Enum.to_list And it returns date list of dates and each date…
D.R
  • 689
  • 2
  • 13
  • 27
22
votes
7 answers

How do I convert timestamp to datetime.date in pandas dataframe?

I need to merge 2 pandas dataframes together on dates, but they currently have different date types. 1 is timestamp (imported from excel) and the other is datetime.date. Any advice? I've tried pd.to_datetime().date but this only works on a single…
Afo B
  • 541
  • 1
  • 4
  • 9
1 2 3
99
100