Hi,

Unfortunately the weeWX dot code formatting only lets you display local 
times. Depedning on what you want to do there are a number of ways you can 
produce a GMT date time. If you were working with $current.dateTime I 
assume you are wanting to include this in a template. For one offs the 
easiest way is to insert a little python code in the template to do the 
formatting for you. Something like:

#import time
#set $gmt_st = time.gmtime($current.dateTime.raw)
#set $gmt = time.strftime("%H:%M:%S", $gmt_st)
Local=$current.dateTime.format("%H:%M:%S") GMT=$gmt


included in your template will result in something like:

Local=14:20:00 GMT=04:20:00

being displayed in the generated file. The first 3 lines can appear 
anywhere in your template as long as they are before your first use of 
$gmt. The various format codes available are listed at the bottom of this 
page 
<https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>.
 
Of course if you are wanting to do something more complex like repeated use 
with various formats this approach gets a little timesome and something 
like a SLE might be more efficient.

Gary

On Friday, 8 September 2017 10:53:31 UTC+10, Bruce Huddleston wrote:
>
> I've looked through the documentation and don't see a way to display UTC 
> time using the $current.dateTime.format method.
>
> I have $current.dateTime.format("%H%M") displaying local Rpi time but I 
> need both. It's probably something easy but I can't figure it out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to