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
23
votes
3 answers

How to fix issue with 'datetime.datetime' which has no attribute timedelta?

How will I fix this problem on Python. Here's my code: import time import datetime from time import mktime from datetime import datetime date = '20120814174530' date_to_strp = time.strptime(date, '%Y%m%d%H%M%S') #convert the…
obutsu
  • 287
  • 1
  • 3
  • 12
23
votes
2 answers

Convert mysql DATETIME column to epoch seconds

I have a column mysql datetime that is in DATETIME format. Is there a way to SELECT this column in epoch seconds? If not, what would be the best way of converting the datetime format to epoch seconds? What type of field would be the best to capture…
David542
  • 96,524
  • 132
  • 375
  • 637
23
votes
1 answer

Behind The Scenes: Core Data dates stored with 31 year offset?

I know, "no user-serviceable parts inside" ... but I'm curious: In a Core Data sqlite3 DB, it seems I can get at the date within a ZDATE like so: sqlite> select datetime(ZDATE,'unixepoch','31 years','localtime') from ZMYCLASS; 2003-12-11…
Joe D'Andrea
  • 5,101
  • 6
  • 46
  • 67
23
votes
6 answers

How to format date and time string in C++

Let's say I have time_t and tm structure. I can't use Boost but MFC. How can I make it a string like following? Mon Apr 23 17:48:14 2012 Is using sprintf the only way?
Tae-Sung Shin
  • 18,949
  • 31
  • 125
  • 230
23
votes
7 answers

How to convert DateTime to Date

How can I convert Date to DateTime and vice versa? E.g. Date dt = new Date(); Now I want to covert this to DateTime. Also DateTime dtim = new DateTime(); Now I want to convert it to Date.
user93796
  • 17,329
  • 29
  • 84
  • 133
22
votes
3 answers

How to use a string/column value as a mysql date interval constant (DAY, MONTH...)?

I have three columns: a date column, a integer column, and a varchar column like this: +------------+------+---------+ | date |value | unit | +------------+------+---------+ | 2009-01-01 | 2 | DAY | | 2009-02-01 | 3 | MONTH |…
Beat
22
votes
4 answers

Specific Time Range Query in SQL Server

I'm trying to query a specific range of time: i.e. 3/1/2009 - 3/31/2009 between 6AM-10PM each day Tues/Wed/Thurs only I've seen that you can get data for a particular range, but only for start to end and this is quite a bit more specific. I…
Fry
  • 3,426
  • 9
  • 34
  • 50
22
votes
1 answer

Get the number of days in the current month in Java

Possible Duplicate: Find the number of days in a month in Java I know these are some ways to do it, but I'm having hard time find information how to do it without passing specified date. I just want to get number of days in a current month, how…
Jacek Kwiecień
  • 11,495
  • 19
  • 75
  • 148
22
votes
3 answers

Change datetime to Unix time stamp in Python

Please help me to change datetime object (for example: 2011-12-17 11:31:00-05:00) (including timezone) to Unix timestamp (like function time.time() in Python).
Thelinh Truong
  • 534
  • 1
  • 7
  • 18
22
votes
4 answers

VBA Date as integer

is there a way to get the underlying integer for Date function in VBA ? I'm referring to the integer stored by Excel to describe dates in memory in terms of number of days (when time is included it can be a float then I guess). I'm only interest in…
BuZz
  • 13,038
  • 26
  • 73
  • 128
22
votes
14 answers

How to change the date format from MM/DD/YYYY to YYYY-MM-DD in PL/SQL?

I have a date column in a table stored as MM/DD/YYYY format. I have to select and store the same date in another table in YYYY-MM-DD format i.e. XSD Date Format. But I am not able to do it. I am using this query: select…
user972548
  • 249
  • 1
  • 3
  • 4
22
votes
2 answers

Convert a month abbreviation to a numeric month, in R

I'm trying to write a function to convert 3-letter month abreviations to numeric values in R. Here's what I have, I was wondering if there's a better way to do this: numMonth <- function(x) { months <-…
Zach
  • 27,553
  • 31
  • 130
  • 193
22
votes
6 answers

Best practices for DateTime serialization in .NET 3.5

Some 4 years back, I followed this MSDN article for DateTime usage best practices for building a .Net client on .Net 1.1 and ASMX web services (with SQL 2000 server as the backend). I still remember the serialization issues I had with DateTime and…
Gulzar Nazim
  • 50,518
  • 24
  • 125
  • 170
22
votes
2 answers

Assigning null/Nullable to DateTime in Ternary Operation

I have a statement like DateTime ? dt = (string1 == string2) ? null; (DateTime)(txtbox.Text); which I cannot compile. Reason is : null cannot be assigned to DateTime. So, I have to declare a Nullable nullable variable and replace null…
iTSrAVIE
  • 828
  • 2
  • 12
  • 25
22
votes
3 answers

PHP, MySQL and Time Zones

I am trying to integrate a timezone system in my app, i've really tried hard on avoiding making timezone-aware apps upto now - but its a mandatory requirement now so got no choice. TimeZones it just goes over my head. I've read several topics on…
Zubair1
  • 2,660
  • 2
  • 27
  • 37
1 2 3
99
100