Berkeley CSUA MOTD:Entry 24111
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2002/3/14 [Computer/SW/Languages/Perl] UID:24111 Activity:moderate
3/13    Does anybody know a command to display the current Julian Date?
        \_ man cal
             \_ the "Julian Calendar" is not the "Julian Date"
                cal shows the Julian Calendar. the Julian date for right
                now is about: 2452347.59
                \- the power of emacs:
                (calendar-print-julian-date)
                Show the Julian calendar equivalent of the date
                under the cursor.
                 \_ The Julian period (and the Julian day number) must
                    not be confused with the Julian calendar.
                    The Julian period starts on 1 January 4713 BC
                    This is what I'm looking for.
                    \- you can do this using "astronomical date"
                    that is M-x calendar-print-astro-day or something
                    like that in emacs
                     Astronomical (Julian) day number (at noon UTC): 2452347.0
                    The emacs calenday can pretty much do anything, although
                    in some cases you might have to write some el based but
                    the primitives are all there. UTSL. ok tnx --psb
                        \_ Thanks, but how about something simple I can run
                           from the command line? By the way, how do I get
                           the number of seconds since the UNIX Epoch?
                                        \_ perl -e 'print time . "\n"'
                                           \_ perl -e 'print "$^T\n"'
                                              \- (gnu)date +%s. i think there
                                            is a program called ctime too.
                                            if you need from shell there are
                                            various astro-calculation oriented
                                            libs you can use to convert between
                                            date fmts also support for sideral
                                            time periods and such. dunno if it
                                            excists for high level lang like
                                            perl but assume so. ok tnx --psb
        \_ Everything can be done in perl.  If it can't be done in perl, you
           didn't really need it done anyway.
           \_ I'd like to see you write a device drive in perl.