3

I was able to convert the 9.2e18 AD to a date, but I am confused about the exact date. Which date is 9.2e18 AD and and 9.2e18 BC?

Time span (absolute) - [9.2e18 BC, 9.2e18 AD] i.e +/- 9.2e18 years

NumPy documentation, section "Datetime Units" under "Datetimes and Timedeltas"

Code Meaning Time span (relative) Time span (absolute)
Y year +/- 9.2e18 years [9.2e18 BC, 9.2e18 AD]
M month +/- 7.6e17 years [7.6e17 BC, 7.6e17 AD]
W week +/- 1.7e17 years [1.7e17 BC, 1.7e17 AD]
D day +/- 2.5e16 years [2.5e16 BC, 2.5e16 AD]
  1. I have converted the 9.2e18 (epoch - I believe it represented in epochs) to a date. It gave me very big date which I did not expect. Are my assumptions accurate?
  2. How many years was covered according to the date 1970-01-01 from 9.2e18 BC?
  3. What are some examples using this timespan to judge my assumptions to get the date of 9.2e18 BC and 9.2e18 AD with units by NumPy?
  • 3
    These numbers certainly don't represent years, it doesn't make sense to interpret them like this. Please give more detail: where do you read this date from and/or how it was converted? – Erwan Aug 10 '21 at 11:19
  • I have updated the question – Rinshan Kolayil Aug 10 '21 at 11:30
  • What do you plan to do with it, anyway? It shows the technical range of specified dates, which is absurd dates by design and it wouldn't matter unless you plan really long time travelling. – Kirill Fedyanin Aug 10 '21 at 14:05
  • @KirillFedyanin , Let say an example, I have a date (`January 1, 0001`), what is minimum year/day/month i can substract / add. – Rinshan Kolayil Aug 10 '21 at 15:01
  • See, I've update my answer – Kirill Fedyanin Aug 10 '21 at 16:03
  • This entire question seems to be answered with an explanation of how scientific notation functions. The OP's first question strongly implies they are unaware that `9.2e18` is scientific notation for `9.2 x 10^18`, given the whole epoch direction. Given that this is very common knowledge, maybe a mod would like to close? Explaining math notation is generally outside SE's purpose from what I understand. – bsplosion Aug 10 '21 at 20:07
  • @bsplosion thanks for your answer – Rinshan Kolayil Aug 10 '21 at 20:23
  • @bsplosion I do understand `9.2e18`. I just put this value in excel and i got answer instead of calculating, but it just about to know am i wrong? – Rinshan Kolayil Aug 11 '21 at 05:33

2 Answers2

5

From the documentation you referred: "The length of the span is the range of a 64-bit integer times the length of the date or unit."

64 bit integer has values from -2^63 to 2^63-1, which is the same as from -9.2e18 to 9.2e18. So, the time span column shows you which dates would you cover if use only the corresponding units. Note, i.e. that time span for years 12 times bigger then time span for months and 52 times bigger then timespan for weeks.

So, the date 9.2e18BC is literally 9.2 quintillions years before christ

UPD with clarification to comment

First of all, there are two different concepts - the date (like 10th august of 2021) and time duration (like two years). The later is referred as time delta in python. And you can't add/subtract years in numpy from date because different years have different amount of time -- like 365 or 366 days. However you can subtract basically any amount of days like that:

start_date = np.datetime64('0000-01-01')
days_to_substract = np.timedelta64(100, 'D')
print(start_date - days_to_substract) # initial date minus 100 days
>>> -001-09-23

Note, that you can in fact manipulate with dates in vanilla python with datetime, but as mentioned in the other answer, the dates can not be less then 01-01-0001 for basic python without numpy

Kirill Fedyanin
  • 353
  • 1
  • 8
  • Yes, that was one of my concern to reduce years which was not able to do – Rinshan Kolayil Aug 10 '21 at 16:56
  • I was able substract `days_to_substract = np.timedelta64(9223372036854039999, 'D')` this much days as per my coding. May be i am wrong which results in `numpy.datetime64('-25252734927764540-01-03')` – Rinshan Kolayil Aug 10 '21 at 17:09
  • Is this wrong result? World born approximately 4.54 Billions years, Is my calculations wrong. What mistake i done in substraction of days – Rinshan Kolayil Aug 10 '21 at 17:34
  • You mean, why the date is early then the start of the world? Well, they are just numbers, they are not clipped at the start of the world because you're probably the first person who would think about it. – Kirill Fedyanin Aug 10 '21 at 18:28
  • A 64-bit signed int can represent values from `-(2^63)` to `2^63 - 1`, assuming 2's complement. Definitely not a negative exponent like `-63`; that would require floating-point or fixed-point. And not `+1`. Representing zero uses up one of the encodings, leaving fewer positive values than negative. (Again assuming [2's complement](https://en.wikipedia.org/wiki/Two%27s_complement), the other well-known encodings are symmetric around zero in their value-range). – Peter Cordes Aug 10 '21 at 18:41
  • @PeterCordes, thanks, you're right of course, I fixed it. – Kirill Fedyanin Aug 10 '21 at 18:53
  • @all, thanks for your informations – Rinshan Kolayil Aug 11 '21 at 07:07
2

1 (Y)ear = 3.154e+16 nanoseconds.

In scientific notation, "E" refers to a power of 10. | So (9.2E+18) is written as "9.2 × 10^18" in scientific notation. The decimal value of (9.2E+18) would equal 9200000000000000000.

In reference to (Y)ears, what does the value (9.2E+18) mean?

  • 9.2 x 10^18 Milliseconds = 291,536,394 Years.
  • 9.2 x 10^18 Nanoseconds = 291.53639 Years.

The DateTime value type represents dates and times with values ranging from 00:00:00 (midnight), January 1, 0001 Anno Domini (Common Era) through 11:59:59 P.M., December 31, 9999 A.D. (C.E.) in the Gregorian calendar.

חִידָה
  • 121
  • 2