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 the data types TIMESTAMP [WITHOUT TIME ZONE] and TIMESTAMP WITH TIME ZONE are collectively referred to as timestamps. (And the data types DATE, TIME, and TIMESTAMP are collectively referred to as datetime types.)

  • 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 a 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.


Helpful articles

70365 questions
28
votes
4 answers

Format datetime in TypeScript

I'm receiving date and time from the REST API in the below format 2016-01-17T:08:44:29+0100 I want to format this date and time stamp like 17-01-2016 08:44:29 It should be dd/mm/yyyy hh:mm:ss How to format this in TypeScript?
Protagonist
  • 1,649
  • 7
  • 34
  • 56
28
votes
11 answers

Docker Timezone in Ubuntu 16.04 Image

I have created a Docker container using the Ubuntu 16.04 image. docker run -it -d --name containername -v /var/www/public --privileged ubuntu after creating the container, I checked the date inside the container: $ date Tue Oct 25 08:10:34 UTC…
Rajkumar .E
  • 1,440
  • 3
  • 20
  • 34
28
votes
3 answers

Simplest way to extract date from timestamp

Consider the following timestamp timestamp <- ymd_hms("2011-08-10 14:00:00", tz = "Pacific/Auckland") > timestamp [1] "2011-08-10 14:00:00 NZST" What is the simplest way to get the day part 2011-08-10 from it, and making sure this day is a proper…
ℕʘʘḆḽḘ
  • 18,566
  • 34
  • 128
  • 235
28
votes
3 answers

How to store UNIX timestamps with MySQL

Some background: My website depends heavily on coordinating users across all kinds of different time zones. I am using Carbon to handle my time zone conversions and calculations on the server side and moment.js on the client. As a result the design…
Jethro Hazelhurst
  • 3,230
  • 7
  • 38
  • 80
28
votes
8 answers

Need parse dd.MM.yyyy to DateTime using TryParse

I need to parse string to DateTime. The string is always in the following format "10.10.2010" That means dd.MM.yyyy, separated with dots. I want to use DateTime.TryParse or any other method. Please suggest. UPDATE Updated the question. I am just…
Captain Comic
  • 15,744
  • 43
  • 110
  • 148
28
votes
2 answers

How to define format when using pandas to_datetime?

I want to plot RESULT vs TIME based on a testresult.csv file that has following format, and I have trouble to get the TIME column's datatype defined properly. TIME,RESULT 03/24/2016 12:27:11 AM,2 03/24/2016 12:28:41 AM,76 03/24/2016 12:37:23…
ju.
  • 1,016
  • 1
  • 13
  • 34
28
votes
2 answers

Is there a full implementation for ISO-8601 date parsing for Ruby?

The Time.iso8601 method is a restricted subset of ISO-8601. What are its limitations? Does anyone know of a full implementation for Ruby? I'm using MRI 1.8.7. Update It looks like there isn't a single class that handles all of the various 8601…
Chris McCauley
  • 25,824
  • 8
  • 48
  • 65
28
votes
5 answers

Convert SQL server datetime fields to compare date parts only, with indexed lookups

I've been doing a convert(varchar,datefield,112) on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields. Now, I'm hearing that…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
28
votes
2 answers

Java DateTimeFormatter for time zone with an optional colon separator?

I'm trying to build a DateTimeFormatter that can accepts offset with colon or offset without colon. Is there a way to pass this test : DateTimeFormatter dateTimeFormatter =…
Nelson G.
  • 5,145
  • 4
  • 43
  • 54
28
votes
6 answers

Date time conversion and extract only time

Want to change the class for Time to POSIXlt and extract only the hours minutes and seconds str(df3$Time) chr [1:2075259] "17:24:00" "17:25:00" "17:26:00" "17:27:00" ... Used the strptime function df33$Time <- strptime(df3$Time, format =…
Antex
  • 1,364
  • 4
  • 18
  • 35
28
votes
4 answers

Store timestamp with time 00:00:00

I want to store a timestamp in the database with time component as 00:00:00. The following code: $start_date = Carbon::createFromFormat('d-m-Y', $date_interval["start_date"]); $end_date = Carbon::createFromFormat('d-m-Y',…
html_programmer
  • 18,126
  • 18
  • 85
  • 158
28
votes
3 answers

Can SQLAlchemy DateTime Objects Only Be Naive?

I am working with SQLAlchemy, and I'm not yet sure which database I'll use under it, so I want to remain as DB-agnostic as possible. How can I store a timezone-aware datetime object in the DB without tying myself to a specific database? Right now,…
Brighid McDonnell
  • 4,293
  • 4
  • 36
  • 61
28
votes
7 answers

What was midnight yesterday as an epoch time?

I'm trying to get my head around the datetime module. I know the time now as an epoch and the time an event last happened (as an epoch time). What I need to do is figure out whether that event happened between midnight and midnight of yesterday. t…
t0mmyt
  • 493
  • 1
  • 7
  • 14
28
votes
2 answers

How do you convert a python time.struct_time object into a ISO string?

I have a Python object: time.struct_time(tm_year=2013, tm_mon=10, tm_mday=11, tm_hour=11, tm_min=57, tm_sec=12, tm_wday=4, tm_yday=284, tm_isdst=0) And I need to get an ISO string: '2013-10-11T11:57:12Z' How can I do that?
Anthony
  • 12,407
  • 12
  • 64
  • 88
28
votes
6 answers

Changing the file creation date does not work

I'm using the following to change the creation date of a text file: using System.IO; ... DateTime newCreate = new DateTime(year, month, day, hour, minutes, seconds); File.SetCreationTime("changemydate.txt", newCreate); However this doesn't do…
pandita
  • 4,739
  • 6
  • 29
  • 51
1 2 3
99
100