Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

php help needed

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

php help needed

Post by n9mfk »

Code: Select all

<?php print "<center>Page last modified: " . date ("D M j Y  H:i.", filemtime($page_name))."</center>";?>

Code: Select all

I Like to add a at before the time but im not sure how to do it  date ("D M j Y  H:i.", an not make it part of the date 
thanks beau
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: php help needed

Post by gemini06720 »

How about something like this:

Code: Select all

<div style="text-align: center;">Page last modified: <?php echo date ("D M j Y @ H:i", filemtime($page_name)); ?>.</div>
I do not like using the HTML '<center></center>' elements - I prefer using the CSS 'text-align: <value>' property.

If you want to ensure that the text appears properly space between two other lines of text you could use the following:

Code: Select all

<p style="text-align: center;">Page last modified: <?php echo date ("D M j Y @ H:i", filemtime($page_name)); ?>.</p>
Text can be used with the PHP 'date()' function as long as each text letter is preceded by a single '\' (or a double '\\' in case of an established parameter, such as most of the characters used in the following example):

Code: Select all

<?php echo date ("\\T\\o\\d\\a\\y\'\\s \\d\\a\\t\\e \\i\\s F j, Y \\a\\n\\d \\t\\h\\e \\t\\i\\m\\e \\i\\s H:i"); ?>
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: php help needed

Post by serowe »

n9mfk wrote:

Code: Select all

<?php print "<center>Page last modified: " . date ("D M j Y  H:i.", filemtime($page_name))."</center>";?>

Code: Select all

I Like to add a at before the time but im not sure how to do it  date ("D M j Y  H:i.", an not make it part of the date 
thanks beau
The best way is to use php.net eg:

http://au2.php.net/manual/en/function.date.php

When you want help on a function just call php.net with the funciton after it as I did in the above URL.

HTH
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
Post Reply