Date compare and conversion functions.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PingLeeQuan
Forum Commoner
Posts: 58
Joined: Tue Sep 03, 2002 8:08 am

Date compare and conversion functions.

Post by PingLeeQuan »

I've been looking for a date function/utility to compare 2 dates or even convert a normal date to jullinan date. I looked int to the PHP MAnula but found no such thing. Any suggestions.

CASE:
I have a news tool that i need to perform date validation/conversion.

thanks
--quan
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You could convert the 2 dates to timestamps and then do all the comparisons/maths on them you like:
http://www.php.net/manual/en/ref.datetime.php

You can convert UNIX timestamps to Julian Day using one of the calendar functions:
http://www.php.net/manual/en/ref.calendar.php

Mac
Post Reply