Pergunta

What's the epoch of DateTime's following constructor: DateTime(Int64)?

Foi útil?

Solução

From the DateTime class page on MSDN:

Time values are measured in 100-nanosecond units called ticks, and a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. (C.E.) in the GregorianCalendar calendar (excluding ticks that would be added by leap seconds). For example, a ticks value of 31241376000000000L represents the date, Friday, January 01, 0100 12:00:00 midnight. A DateTime value is always expressed in the context of an explicit or default calendar.

The Int64 parameter is simply the number of ticks, as described above, of course.

Outras dicas

  • a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. (C.E.) in the GregorianCalendar calendar (excluding ticks that would be added by leap seconds).

From the MSDN DateTime entry

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top