Jul 05, 2009, 09:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1]   Go Down
  Print  
Author Topic: today's date snippet?  (Read 1276 times)
0 Members and 1 Guest are viewing this topic.
booyaka
Jr. Member
*
Posts: 21


« on: Sep 17, 2007, 12:10 PM »

hi,
i'd like to display the current day in my document.
I found no snippet doing it, and i dont really feel like using a date TV, because i dont want  the webmaster of my modx website to think he has to edit it (am i wrong?)
please can someone give me a tip?
thanks!
Logged
sirlancelot
Coding Team
*
Posts: 575


PHP, XML, XSL Supporter


WWW
« Reply #1 on: Sep 17, 2007, 02:13 PM »

Create a snippet, and put the following code inside it:
Code:
<?php
$unixtime 
time();
$date strftime('%x %X'$unixtime);

return 
'Current Date/time: '.$date;
?>
strftime() documentation
Logged

booyaka
Jr. Member
*
Posts: 21


« Reply #2 on: Sep 18, 2007, 02:25 AM »

perfect! that's exactly what i wanted.
thank you very much!
Logged
robot
Full Member
***
Posts: 112



« Reply #3 on: Sep 20, 2007, 11:17 AM »

this could be marked to [SOLVED] yeah?
Logged

drew.liverman
davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #4 on: Sep 20, 2007, 11:21 AM »

There is also an existing resource for that specific purpose, which handle formatting too :
http://www.modxcms.com/DateTime-884.html
Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez ŕ l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accčs pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!