asterisk asterisk
2011-Mar-21 11:45 UTC
[asterisk-users] wrong time retrieved from system command
${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 I am looking for help. CK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110321/3bb5418c/attachment.htm>
Ishfaq Malik
2011-Mar-21 12:04 UTC
[asterisk-users] wrong time retrieved from system command
what do you get when you do ${STRFTIME(${EPOCH},,%G%m%d-%H%M%S)} ? Ish On Mon, 2011-03-21 at 19:45 +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 > > I am looking for help. > > CK > -- > _____________________________________________________________________ > -- 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-- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062
Doug Lytle
2011-Mar-21 12:31 UTC
[asterisk-users] wrong time retrieved from system command
asterisk asterisk wrote:> ${STRFTIME(${EPOCH},GMT+8,%G%m%d-%H%M%S)} > > I use the above command to get the system date and timeI don't specify timezone when I'm working with EPOCH, what happens when you remove it? Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Doug Lytle
2011-Mar-21 13:10 UTC
[asterisk-users] wrong time retrieved from system command
asterisk at ck-lee.com wrote:> It is about the same. >Then my guess is that the machine's timezone is incorrect. Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
asterisk asterisk
2011-Mar-21 13:49 UTC
[asterisk-users] wrong time retrieved from system command
With gmt+8, the result is -Mon Mar 21 13:47:59 2011 For linux server timezone I set it via webmin and /etc/localtime is my timezone file i.e. HK at GMT+8 On Mon, Mar 21, 2011 at 9:36 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>wrote:> On Mon, Mar 21, 2011 at 09:23:29PM +0800, asterisk at ck-lee.com wrote: > > The timezone is correct. I have double checked. > > How did you check it? What did you check, specifically? > > -- > Tzafrir Cohen > icq#16849755 jabber:tzafrir.cohen at xorcom.com > +972-50-7952406 mailto:tzafrir.cohen at xorcom.com > http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir > > -- > _____________________________________________________________________ > -- 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/d9fa2830/attachment.htm>
Barry Miller
2011-Mar-21 14:19 UTC
[asterisk-users] wrong time retrieved from system command
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 2011Have 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
asterisk asterisk
2011-Mar-21 14:24 UTC
[asterisk-users] wrong time retrieved from system command
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>
Tilghman Lesher
2011-Mar-21 22:53 UTC
[asterisk-users] wrong time retrieved from system command
On Monday 21 March 2011 06:45:37 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 > > I am looking for help.Do you have an file (or symlink) in /usr/share/zoneinfo called "GMT+8"? I certainly don't, and I'm not running anything different from the standard set of zone files. If you don't have that entry, then the timezone code will use UTC (i.e. no local differentiations). -- Tilghman