Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi
I was trying to capture the create time of a QVD file and convert it from local time to UTC.
But I found that QVDCreateTime function will return a timestamp with timezone UTC rather than my local time zone.
Can we control the timezone of the return from QVDCreateTime function?
Thank you
Paco
 
					
				
		
I should have said that I think the return of QVDCreateTime function default the time zone to be 'UTC' while the time value is in local time.
Hope that will make it clear.
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It returns the time as in your local system.
 
					
				
		
Hi tresesco:
Thank you for your reply. But I don't think what you are saying is the case.
Can you try the following two lines of script?
LET v1 = TIMESTAMP(CONVERTTOLOCALTIME(QVDCREATETIME('[Your QVD File]'),'UTC'), 'YYYY-MM-DD hh:mm:ss');
LET v2 = TIMESTAMP(QVDCREATETIME('[Your QVD File]'), 'YYYY-MM-DD hh:mm:ss');
I am not in UTC, but the above script will result in v1 equal to v2.
Let me know what do you get from the above script.
Cheers,
PC
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
It will return the local system time, check your system is in UTC zone.
Regards,
Jagan.
 
					
				
		
Hi Jagan:
Where can I check my system timezone.
If I click on the clock on the bottom right and click 'Change date and time settings...', then it is showing the following:
(UTC+10:00) Canberra, Melbourne, Sydney
Please let me know if I am looking at the wrong place.
Thank you.
PC
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Let's not make it complicated. Why don't we try simply
Let vQVDtime = QvdCreateTime('[Your QVD File]');
Don't you get the time of your Windows time in the variable? I get it so.
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		To answer your ConvertToLocaTime() - it takes input as UTC/GMT and if you convert it to UTC again it will always return the same output. Hope this explains your query.
So it's about understanding the ConvertToLocalTime() function right.
 
					
				
		
Hi tresesco:
Thanks for your clarification. That make sense now.
Then I have another questions. How can I convert a local time to UTC with Daylight Saving handled automatically?
Thank you.
PC
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		ConvertToLocalTime(YourTime, 'UTC-10:00'); ?
