[asterisk-users] wrong time retrieved from system command

asterisk asterisk asterisk at ck-lee.com
Mon Mar 21 09:24:48 CDT 2011


Thanks,

You give me the right answer.

On Mon, Mar 21, 2011 at 10:19 PM, Barry Miller
<asterisk-users at notanet.net>wrote:

> On Mon, Mar 21, 2011 at 07:45:37PM +0800, asterisk asterisk wrote:
> > ${STRFTIME(${EPOCH},GMT+8,%G%m%d-%H%M%S)}
> >
> > I use the above command to get the system date and time
> >
> > it returns 20110321-034329
> >
> > but it is exactly 8 hours early than the system time when I type date in
> > linux terminal
> >
> > Mon Mar 21 19:43:35 HKT 2011
>
> Have you tried "${STRFTIME(${EPOCH},Hongkong,%G%m%d-%H%M%S)}" ?
>
> $ date ; TZ=UTC date ; TZ=Hongkong date
> Mon Mar 21 10:13:31 EDT 2011
> Mon Mar 21 14:13:31 UTC 2011
> Mon Mar 21 22:13:31 HKT 2011
>
> --
> Barry
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110321/7422703f/attachment.htm>


More information about the asterisk-users mailing list