jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Question about sprintf


Morten Bo Johansen <mojo@xxxxxxxx> wrote:
>I suppose I need to call the "date" command for this? I tried
>
>    run_shell_cmd (sprintf ("date +%Y-%m-%d %H:%M"));

Use the localtime function, which returns a structure that you can use
to write the data in any format that you want.  See
$JED_ROOT/lib/chglog.sl for an example of its use.

>The next question is not really jed related but perhaps someone
>could tell me what command could be used to get one's time zone
>in the format specified above?

The gmtime function returns the time in GMT.  You can probably use it
and localtime to figure out the timezone offset.

Good luck,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]