[php] mktime voor 1969

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • Suffie
  • Registratie: Maart 2002
  • Laatst online: 27-01-2023
als ik in mktime voor 1-1-1970 uitkom, dan wil die niet meer rekenen, maar dan geeft een "unexpected error in date()"

nu heb ik al gevonden op php.net:
mktime - Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970) and the time specified.
is er een mogelijkheid om toch te rekenen voor 1970?

[ Voor 3% gewijzigd door Suffie op 23-01-2003 15:52 ]

I don't suffer from insanity, I enjoy every minute of it
Trotse mama van Thijs&Bas


Acties:
  • 0 Henk 'm!

Verwijderd

Het officiele antwoord:
[18 Oct 2001 5:55am] hholzgra@php.net
behaviour of unix timestamp functions for dates
before 1.1.1970 is simply undefined and depends
on the system *and* c library implementation you
use

so stay away from undefined value ranges :)
Nee, dus. Als je dus met data voor 1970 moet werken moet je een andere manier vinden om data te representeren.

HTH :)

[ Voor 42% gewijzigd door Verwijderd op 23-01-2003 16:05 ]


Acties:
  • 0 Henk 'm!

  • djc
  • Registratie: December 2001
  • Laatst online: 08-09 23:18

djc

Je zou zelf een verbeterde functie kunnen schrijven die voor die datum een negatief getal teruggeeft, maar dat is waarschijnlijk nog best lastig...

Rustacean


Acties:
  • 0 Henk 'm!

Verwijderd

[20 Nov 2002 7:57pm] alan_k@php.net
try looking at the Date Package in PEAR
pear.php.net
Deze dus: http://pear.php.net/package-info.php?pacid=57
Generic classes for representation and manipulation of
dates, times and time zones without the need of timestamps,
which is a huge limitation for php programs. Includes time zone data,
time zone conversions and many date/time conversions.
It does not rely on 32-bit system date stamps, so
you can display calendars and compare dates that date
pre 1970 and post 2038. This package also provides a class
to convert date strings between Gregorian and Human calendar formats.
Enjoy :)

[ Voor 54% gewijzigd door Verwijderd op 23-01-2003 16:20 ]