Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.1.2 build 3055 - 4 November 2019.
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

Web Tag <DaysSince30Dec1899>

Discussion and questions about Cumulus weather station software version 1. This section and its subforums are the main place to get help with Cumulus. Anything which is not specific to the type of weather station goes in here; for anything specific to a type of weather station, please use the appropriate subforum. Use the 'website development' section for any questions relating to creating or running a web site for Cumulus data. Discussion of the stations themselves in these sections is fine.
Post Reply
User avatar
krmidas
Posts: 214
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Web Tag <DaysSince30Dec1899>

Post by krmidas » Fri 08 Nov 2019 5:59 pm

Has anyone had success with the web tag <DaysSince30Dec1899> (replacing 30Dec1899 with their own date)? I've tried it and it doesn't deliver a value. My date is 18 June 2005. I've tried "Jun" as well as "June". Neither worked.

-Tom
Tom Keramidas, Lake Zurich, IL, USA
Image

User avatar
mcrossley
Posts: 5733
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Web Tag <DaysSince30Dec1899>

Post by mcrossley » Fri 08 Nov 2019 7:05 pm

You can't change the date, the tag is <#DaysSince30Dec1899> the calendar base date, you cannot specify an arbitrary date.

User avatar
krmidas
Posts: 214
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Web Tag <DaysSince30Dec1899>

Post by krmidas » Fri 08 Nov 2019 11:52 pm

I wish there was a tag to indicate the station age (in days), which in my case is greater than the number of days I've been using Cumulus.
Tom Keramidas, Lake Zurich, IL, USA
Image

User avatar
beteljuice
Posts: 2770
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: Web Tag <DaysSince30Dec1899>

Post by beteljuice » Sat 09 Nov 2019 5:07 am

You could always use some javascript or php ;)
Image
......................Imagine, what you will KNOW tomorrow !

RayProudfoot
Posts: 2703
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Web Tag <DaysSince30Dec1899>

Post by RayProudfoot » Sat 09 Nov 2019 9:55 am

krmidas wrote:
Fri 08 Nov 2019 11:52 pm
I wish there was a tag to indicate the station age (in days), which in my case is greater than the number of days I've been using Cumulus.
I've been using <#DaysSinceRecordsBegan> for ages. That sounds like it would suit your needs. Visible in a grey banner on my site: http://www.cheadlehulmeweather.co.uk/
Cheers,
Ray, Cheshire.

Image

User avatar
beteljuice
Posts: 2770
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: Web Tag <DaysSince30Dec1899>

Post by beteljuice » Sat 09 Nov 2019 1:46 pm

<#DaysSinceRecordsBegan> ...
... which in my case is greater than the number of days I've been using Cumulus
Javascript is very unfriendly with date and time, but this will do what you want:

Code: Select all

<span id="since"></span> days of records<br/>

<script>
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth()+1; //January is 0!
    var yyyy = today.getFullYear();
    if(dd<10) {
    dd='0'+dd
    }
    if(mm<10) {
    mm='0'+mm
    }
    today = yyyy+'/'+mm+'/'+dd;
	
    fromdate = "2006/01/08"; // enter your from date yyyy/mm/dd
	
    var date2 = new Date(today);
    var date1 = new Date(fromdate);
    var timeDiff = Math.abs(date2.getTime() - date1.getTime());
    var dayDifference = Math.ceil(timeDiff / (1000 * 3600 * 24));
    document.getElementById("since").innerHTML = dayDifference;
</script>
Note: The <script> must be somewhere below the <span> else it can't 'see' it.

... and yes I tested it ;)
Image
......................Imagine, what you will KNOW tomorrow !

Post Reply