In the BSON document specification DateTimes are stored as a signed 64-
bit number offset (in milliseconds) from the UNIX Epoch
(1970-01-01T00:00:00Z). So the range of dates in BSON is:
Min: 1970-01-01T00:00:00Z - 9,223,372,036,854,775,808 ms
Max: 1970-01-01T00:00:00Z + 9,223,372,036,854,775,807 ms
However, you are more likely going to be limited by the DateTime type
in your programming language of choice. For example, in C# the range
is:
Min: 0001-01-01T00:00:00Z (1970-01-01T00:00:00Z - 62,135,596,800,000
ms)
Max: 9999-12-31T23:59:59.999999Z (1970-01-01T00:00:00Z +
253,402,300,800,000 ms)
So you can see that the range of DateTime values in BSON is much
larger than the range of DateTime values in C# (it's also a bit less
precise since it is measured in milliseconds).
I don't know what the range of Date values in JavaScript is. Perhaps a
JavaScript expert can chime in.
I also agree with the comments that DateTime values that far in the
future or past don't make much sense (in most cases).
On Jan 11, 4:34 am, Andreas Jung <
li...@zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ishaan wrote:
> > db.temporary.insert({ date2: new Date(999999,1,1) }); // Sets date2 to
>
> Using year 99999 really does not make sense here.
>
> - -aj
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJNLCQtAAoJEADcfz7u4AZjVGILvRVi4SAxlLRV/PKWDeDSUMbp
> Tm9a5EBls6s/5y+XM7o4xZSvsXR4jkAPOHk0W48TprnttuPdXaRNuUQDFOW8vfob
> xlLzXRaG1dfKFaovu0IyYzi5i2S7uh3jEYRbm+RJsye4DMmLz+d3l1TwWQ9p0mN/
> c9PAxZL/0CQ2T0EXTnDaxPItoKgoStgmJ5Yqk0l3RLKmI36ZHnX2m+slzm7Eb4lf
> aQQLZJy1FgiI4cf3cmoPFo4Q72k65eb3uIye9gUfbcM+2EkDB1iuGr/IvusjUnfo
> hHd73CBWZ1dwOnXYOObm28Ivi+Kd2YJJr8D/DhEaf3rskQxAr2l1U3pz0kJ/37Gh
> CdNpJjmQgGCmSBPYuR+ogc06GjmtrxKz+xfcPDxMXlhYF392AakcoLx2zvHCEQfm
> 6TBhGsLMqrLMUBpv0CimCrLoyEJf0kvuADRsbowr5vLJzFlRZA+oua7Yk3F17pAq
> WeePZajUxsgY+TYTK43F5EnBLCmRZpM=
> =NIT0
> -----END PGP SIGNATURE-----
>
> lists.vcf
> < 1KViewDownload