change from 12-hour to 24-hour format in US units

217 views
Skip to first unread message

bgra...@umw.edu

unread,
Mar 9, 2016, 2:48:42 PM3/9/16
to weewx-user
Hello,

I am using the US template and adding dual metric/US units for certain data displayed. Is it possible to change the various time displays to show 24-hour format and drop the AM/PM?
Can this be a global change or does it need to be modified for each item? Thanks.

Bob

Dave Webb KB1PVH

unread,
Mar 9, 2016, 2:56:58 PM3/9/16
to weewx...@googlegroups.com
You need to set it in skin.conf

This is how mine is set

 [[TimeFormats]]
        #
        # This section sets the string format to be used
        # each time scale.
        #
        day        = %H:%M
        week       = %H:%M on %A
        month      = %d-%b-%Y %H:%M
        year       = %d-%b-%Y %H:%M
        rainyear   = %d-%b-%Y %H:%M
        current    = %B-%d-%Y %H:%M
        ephem_day  = %H:%M
        ephem_year = %d-%b-%Y %H:%M

Can be viewed here qsl.net/kb1pvh/weather

DirectiveMeaningNotes
%aLocale’s abbreviated weekday name. 
%ALocale’s full weekday name. 
%bLocale’s abbreviated month name. 
%BLocale’s full month name. 
%cLocale’s appropriate date and time representation. 
%dDay of the month as a decimal number [01,31]. 
%HHour (24-hour clock) as a decimal number [00,23]. 
%IHour (12-hour clock) as a decimal number [01,12]. 
%jDay of the year as a decimal number [001,366]. 
%mMonth as a decimal number [01,12]. 
%MMinute as a decimal number [00,59]. 
%pLocale’s equivalent of either AM or PM.(1)
%SSecond as a decimal number [00,61].(2)
%UWeek number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.(3)
%wWeekday as a decimal number [0(Sunday),6]. 
%WWeek number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.(3)
%xLocale’s appropriate date representation. 
%XLocale’s appropriate time representation. 
%yYear without century as a decimal number [00,99]. 
%YYear with century as a decimal number. 
%ZTime zone name (no characters if no time zone exists). 
%%A literal '%' character.

Dave-KB1PVH

--
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 weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bgra...@umw.edu

unread,
Mar 9, 2016, 3:29:12 PM3/9/16
to weewx-user
Much appreciated, Dave, it's just what I need.  Bob
Reply all
Reply to author
Forward
0 new messages