Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

time::julianday(3pm) [debian man page]

Time::JulianDay(3pm)					User Contributed Perl Documentation				      Time::JulianDay(3pm)

NAME
Time::JulianDay -- Julian calendar manipulations SYNOPSIS
use Time::JulianDay $jd = julian_day($year, $month_1_to_12, $day) $jd = local_julian_day($seconds_since_1970); $jd = gm_julian_day($seconds_since_1970); ($year, $month_1_to_12, $day) = inverse_julian_day($jd) $dow = day_of_week($jd) print (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$dow]; $seconds_since_jan_1_1970 = jd_secondslocal($jd, $hour, $min, $sec) $seconds_since_jan_1_1970 = jd_secondsgm($jd, $hour, $min, $sec) $seconds_since_jan_1_1970 = jd_timelocal($sec,$min,$hours,$mday,$month_0_to_11,$year) $seconds_since_jan_1_1970 = jd_timegm($sec,$min,$hours,$mday,$month_0_to_11,$year) DESCRIPTION
JulianDay is a package that manipulates dates as number of days since some time a long time ago. It's easy to add and subtract time using julian days... The day_of_week returned by day_of_week() is 0 for Sunday, and 6 for Saturday and everything else is in between. ERRATA
Time::JulianDay is not a correct implementation. There are two problems. The first problem is that Time::JulianDay only works with integers. Julian Day can be fractional to represent time within a day. If you call inverse_julian_day() with a non-integer time, it will often give you an incorrect result. The second problem is that Julian Days start at noon rather than midnight. The julian_day() function returns results that are too large by 0.5. What to do about these problems is currently open for debate. I'm tempted to leave the current functions alone and add a second set with more accurate behavior. There is another implementation in Astro::Time that may be more accurate. GENESIS
Written by David Muir Sharnoff <cpan@dave.sharnoff.org> with help from previous work by Kurt Jaeger aka PI <zrzr0111@helpdesk.rus.uni-stuttgart.de> based on postings from: Ian Miller <ian_m@cix.compulink.co.uk>; Gary Puckering <garyp%cognos.uucp@uunet.uu.net> based on Collected Algorithms of the ACM ?; and the unknown-to-me author of Time::Local. LICENSE
Copyright (C) 1996-1999 David Muir Sharnoff. License hereby granted for anyone to use, modify or redistribute this module at their own risk. Please feed useful changes back to cpan@dave.sharnoff.org. perl v5.12.3 2011-05-06 Time::JulianDay(3pm)

Check Out this Related Man Page

Time::gmtime(3pm)					 Perl Programmers Reference Guide					 Time::gmtime(3pm)

NAME
Time::gmtime - by-name interface to Perl's built-in gmtime() function SYNOPSIS
use Time::gmtime; $gm = gmtime(); printf "The day in Greenwich is %s ", (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ $gm->wday() ]; use Time::gmtime qw(:FIELDS); gmtime(); printf "The day in Greenwich is %s ", (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ $tm_wday ]; $now = gmctime(); use Time::gmtime; use File::stat; $date_string = gmctime(stat($file)->mtime); DESCRIPTION
This module's default exports override the core gmtime() function, replacing it with a version that returns "Time::tm" objects. This object has methods that return the similarly named structure field name from the C's tm structure from time.h; namely sec, min, hour, mday, mon, year, wday, yday, and isdst. You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that this still overrides your core functions.) Access these fields as variables named with a preceding "tm_" in front their method names. Thus, "$tm_obj->mday()" corresponds to $tm_mday if you import the fields. The gmctime() function provides a way of getting at the scalar sense of the original CORE::gmtime() function. To access this functionality without the core overrides, pass the "use" an empty import list, and then access function functions with their full qualified names. On the other hand, the built-ins are still available via the "CORE::" pseudo-package. NOTE
While this class is currently implemented using the Class::Struct module to build a struct-like class, you shouldn't rely upon this. AUTHOR
Tom Christiansen perl v5.18.2 2013-11-04 Time::gmtime(3pm)
Man Page