LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2011, 09:49 AM   #1
cheltz
Member
 
Registered: Apr 2010
Posts: 62

Rep: Reputation: 2
Julian date converter


I have this method to convert Julian TIme to normal time via Perl.
(i.e)

#!/usr/bin/perl
$epochseconds="@ARGV[0]";
($second, $minute, $hour) = gmtime($epochseconds);
print sprintf("%02d:%02d:%02d\n", $hour, $minute, $second);



Does anyone know a way to convert the "DATE" also in perl?


Thank You in advance for helping out
 
Old 02-01-2011, 09:57 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
What do you mean by "Julian Time"? If you mean the Julian Calendar, then it doesn't seem like that's what your programme is doing... It's working out the Gregorian date/time based on the input.

However, this is the output format for the gmtime function, so you can grab the day/month/year... Then, whatever non-Gregorian calendar you're trying to get to, you just need to work backwards towards the epoch making corrections
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Julian date from calender date tostay2003 Programming 17 09-03-2012 05:10 PM
date in julian format nanda22 Linux - Newbie 9 09-03-2012 05:00 PM
Julian date converter to gregorian date cheltz Linux - General 6 05-04-2010 01:02 PM
[SOLVED] php convert julian date to gregorian format? MrUmunhum Programming 4 05-06-2009 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration