Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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:"") + ")";

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.
 
Share this answer
 
v2
Comments
vallikelam 21-Apr-11 4:55am    
Thank u very much sir I got it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900