CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Y2k date troubles

 



muinatit
Deleted

Feb 20, 2001, 3:42 PM

Post #1 of 4 (520 views)
Y2k date troubles Can't Post

I'm making a small utility script that returns the date. But the server year is 101. How would I go about changing the year from it's current format into legible format like 2001?

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com


wickedxter
User

Feb 20, 2001, 5:06 PM

Post #2 of 4 (518 views)
Re: Y2k date troubles [In reply to] Can't Post

use this
$year = ($year - 100) + 2000;



muinatit
Deleted

Feb 20, 2001, 5:48 PM

Post #3 of 4 (516 views)
Re: Y2k date troubles [In reply to] Can't Post

Thanks! I don't know why I didn't think of that earlier. :p

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com


Jasmine
Administrator / Moderator

Feb 21, 2001, 1:38 AM

Post #4 of 4 (515 views)
Re: Y2k date troubles [In reply to] Can't Post

Just an elaboration -- localtime returns the year minus 1900. So you need to add 1900 to get back to the current year.


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives