如何从_get_tzname()获取时区名称 [英] how to get the time zone name from _get_tzname()

查看:509
本文介绍了如何从_get_tzname()获取时区名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在尝试打印时区名称,但未显示.
我的代码stmt是:

local_machine_time = emailtm.Format(%a,%d%b%Y%H:%M:%S")+(" + get_tzn,_get_tzname(&_ret_value,get_tzn,sizeof(get_tzn),0)+");

当我调试代码时,在get_tzn中我得到了-> 0x05e4f610印度标准时间"
并在local_machine_time中像这样存储-> 2011年4月21日,星期四13:06:23("
但我想显示-> 2011年4月21日,星期四13:06:23(印度标准时间)
请任何人都可以答复我.

Hello

I am trying to print the time zone name but it was not displaying.
My code stmt is:

local_machine_time = emailtm.Format("%a, %d %b %Y %H:%M:%S") + " (" + get_tzn , _get_tzname(&ret_value,get_tzn,sizeof(get_tzn),0) + ")";

when i debugging the code,in get_tzn i get this --> 0x05e4f610 "India Standard Time"
and in local_machine_time it stores like this --> Thu,21 Apr 2011 13:06:23("
but i want to display --> Thu,21 Apr 2011 13:06:23(India Standard Time)
Please any one can reply me.

推荐答案

尝试一下:
Try this:
local_machine_time = emailtm.Format("%a, %d %b %Y %H:%M:%S") + " (" + (0==_get_tzname(&ret_value,get_tzn,sizeof(get_tzn),0)?get_tzn:"") + ")";


祝你好运.
[edit]
列表运算符(,)从左到右就像堆栈一样工作.最后一个参数(即右边)被使用.
_get_tzname(...),get_tzn也应该起作用.但前提是_get_tzname不会失败.
问候.


Good luck.
[edit]
list operators (,) work like stack from left to right. the last parameter (thats the right) is used.
_get_tzname(...),get_tzn should work too. but only if _get_tzname dont fail.
Regards.


这篇关于如何从_get_tzname()获取时区名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆