Meteogram time

Post Reply
User avatar
danville
Observer
Observer
Posts: 10
Joined: Tue Jan 02, 2018 1:42 pm
Location: New York
Station model: Davis Vantage Pro 2
Software: WeeWx
Contact:

Meteogram time

Post by danville » Sat Jan 06, 2018 6:24 pm

The meteorgram (block) time is ahead by 7 hours and I have made certain that all setup time information is correct. What might need to be done to correct this?

User avatar
Gus
Observer
Observer
Posts: 10
Joined: Sun Aug 20, 2017 11:17 pm
Location: Halethorpe, Maryland
Station model: Davis Vantage Pro 2+
Software: Weather Display
Contact:

Re: Meteogram time

Post by Gus » Sat Jan 06, 2018 6:43 pm

Open /homepage/blocks/meteogram/meteogramBlock.php and go to around line 80 and replace the global settings with...
<script>
Highcharts.setOptions({ // Fix for forecast timeline
global: { // useUTC: true is the default setting and graph is x hrs off,
useUTC: false, // change to false and add timezoneOffset : echo($offset * -60)
timezoneOffset: <?php echo $offset*-60?> // value of $offset is calculated in config.php, *-60 to change east-west designation
},
This seems to correct the UTC/ local time problem.
Gus
Davis VP2+, LabJack w/temp sensors & 1-Wire lightning counter on Trigkey G4 Mini PC, 12th Gen Intel Alder Lake N95 Processor, 16GB SDRAM, and 500GB SSD, Windows11
Image

User avatar
Ken Good
Advisor
Advisor
Posts: 62
Joined: Thu Dec 28, 2017 4:10 am
Location: Tyler, Texas
Station model: Davis Vantage Pro 2 Plus
Software: Meteobridge
Contact:

Re: Meteogram time

Post by Ken Good » Sun Jan 07, 2018 4:27 am

I am having the same issue. I tried to make the changes suggested and keep getting error messages. Is this the language:

<script>
Highcharts.setOptions({
global: {
useUTC: true
},
lang: {
months: ['<?php echo lang('january','c')?>', '<?php echo lang('february','c')?>', '<?php echo lang('march','c')?>', '<?php echo lang('april','c')?>', '<?php echo lang('may','c')?>', '<?php echo lang('june','c')?>', '<?php echo lang('july','c')?>', '<?php echo lang('august','c')?>', '<?php echo lang('september','c')?>', '<?php echo lang('october','c')?>', '<?php echo lang('november','c')?>', '<?php echo lang('december','c')?>'],
shortMonths: ['<?php echo lang('janAbbr','c')?>', '<?php echo lang('febAbbr','c')?>', '<?php echo lang('marAbbr','c')?>', '<?php echo lang('aprAbbr','c')?>', '<?php echo lang('mayAbbr','c')?>', '<?php echo lang('junAbbr','c')?>', '<?php echo lang('julAbbr','c')?>', '<?php echo lang('augAbbr','c')?>', '<?php echo lang('sepAbbr','c')?>', '<?php echo lang('octAbbr','c')?>', '<?php echo lang('novAbbr','c')?>', '<?php echo lang('decAbbr','c')?>'],
weekdays: ['<?php echo lang('sundayAbbr','c')?>', '<?php echo lang('mondayAbbr','c')?>', '<?php echo lang('tuesdayAbbr','c')?>', '<?php echo lang('wednesdayAbbr','c')?>', '<?php echo lang('thursdayAbbr','c')?>', '<?php echo lang('fridayAbbr','c')?>', '<?php echo lang('saturdayAbbr','c')?>'],
resetZoom: ['<?php echo lang('default zoom','c')?>']
}
});
</script>

I am UTC -6. How should this be changed?
Thanks in advance.
Image

User avatar
Gus
Observer
Observer
Posts: 10
Joined: Sun Aug 20, 2017 11:17 pm
Location: Halethorpe, Maryland
Station model: Davis Vantage Pro 2+
Software: Weather Display
Contact:

Re: Meteogram time

Post by Gus » Sun Jan 07, 2018 3:24 pm

That is the correct area. Replace...
global: {
useUTC: true
},

with...

global: {
useUTC: false,
timezoneOffset: <?php echo $offset*-60?>
},

See if that works. Also remember to clear the cache files after making change.
Gus
Davis VP2+, LabJack w/temp sensors & 1-Wire lightning counter on Trigkey G4 Mini PC, 12th Gen Intel Alder Lake N95 Processor, 16GB SDRAM, and 500GB SSD, Windows11
Image

User avatar
Ken Good
Advisor
Advisor
Posts: 62
Joined: Thu Dec 28, 2017 4:10 am
Location: Tyler, Texas
Station model: Davis Vantage Pro 2 Plus
Software: Meteobridge
Contact:

Re: Meteogram time

Post by Ken Good » Sun Jan 07, 2018 7:03 pm

Thanks that worked. I was all around it but did not know the programing language. My shots in the dark all fell flat. Thanks again.

Ken
Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Meteogram time

Post by Jachym » Sun Jan 07, 2018 7:25 pm

Thanks Gus, you are right, I will update the block for everyone

Post Reply