Time in UTC/GMT/Zulu time

Bill Campbell bill at celestial.com
Tue Nov 10 16:33:04 PST 2009


On Tue, Nov 10, 2009, Joe Chasan wrote:
>Anyone have an existing bit of code to convert a filepro time field (not
>current time) to UTC/GMT/Zulu time?  seconds not important.
>
>this is on SCO, so unless i'm not thinking of some easier way wth something
>built-in, one would have to parse getenv "TZ" and after the changes to DST,
>this has gotten a bit hairy.

There are several ways to do this, parsing string dates into Unix time
format being generally what I use.  The python datetime module from
genix.com is probably the easiest, and is available here:

	http://www.egenix.com/products/python

The routines I use are basically a python hack which use the
DateTime modules from Zope to parse dates from strings.  These
handle conversion to localtime as well as UTC.  The python time
module which is part of the standard python build provides the
strptime(string, format) method which would probably be the
easiest way to parse FilePro time formats as they are structured.

There's also a getdate.pl perl module that may be available from
CPAN, but it's been a while since I looked at building it.

A simple perl script to do this might be:

#!/usr/local/bin/perl
use Date::Parse
print str2time("@ARGV")

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186  Skype: jwccsllc (206) 855-5792

I have learned what some people are like.  And if some people are like
that, other people must have the means to shoot them.
	Donald Hamilton -- The Vanishers


More information about the Filepro-list mailing list