1
Anonymous
function change Date format
  • 2004/10/5 21:30

  • Anonymous

  • Posts: 0

  • Since:


Hi, in XOOPS exist some function for change the format of the date stored in mysql, I develope a module and need date in format dd-mm-aaaa and MySQL return date in format aaaa-mm-dd or XOOPS using other form for store and return dates?

Thanks for your time.
the new theme of the site is very cool.

2
ackbarr
Re:function change Date format

sure enough:

function formatTimestamp($time$format="l"$timeoffset="")


in addition to the following named date formats, $format can use any parameters the php date() function uses:

l = long date format (defined by _DATESTRING)
m = medium date format (defined by _MEDIUMDATESTRING)
s = short date format (defined by _SHORTDATESTRING)
mysql = Y-m-d H:i:s
rss = D, j M Y H:i:s T

One gotcha with the formatTimestamp function is that it will automatically display the time in the current user's timezone. If that isn't what you are looking for, I'd recommend calling the php date() function directly

PHP Date Function

3
topet05
Re: function change Date format
  • 2004/10/5 21:42

  • topet05

  • Just popping in

  • Posts: 33

  • Since: 2003/4/19


Hi!! Welcome to xoops.org!!

For change the date format, just open the file language\YOUR_LANGUAGE\global.php and find this part:

define("_DATESTRING","Y/n/j G:i:s");
define("_MEDIUMDATESTRING","Y/n/j G:i");
define("_SHORTDATESTRING","Y/n/j");


Here you can change the Long Format Date, the medium format and the short format.

I hope this help you...

Sorry my bad english.

4
cyberik
Re: function change Date format
  • 2004/10/9 3:43

  • cyberik

  • Just popping in

  • Posts: 14

  • Since: 2003/8/21


Quote:

topet05 wrote:
Hi!! Welcome to xoops.org!!

For change the date format, just open the file language\YOUR_LANGUAGE\global.php and find this part:

define("_DATESTRING","Y/n/j G:i:s");
define("_MEDIUMDATESTRING","Y/n/j G:i");
define("_SHORTDATESTRING","Y/n/j");


Here you can change the Long Format Date, the medium format and the short format.

I hope this help you...

Sorry my bad english.


i came to your post by accident. this does solve an issue i've puzzled over for a long long time (due to my somehow laziness to search for the answer). thanx a lot.

5
Anonymous
Re:function change Date format
  • 2004/10/18 20:22

  • Anonymous

  • Posts: 0

  • Since:


Thanks for you help.

6
Anonymous
Re:function change Date format
  • 2004/10/25 18:30

  • Anonymous

  • Posts: 0

  • Since:


For change the date format if you have in database dd-mm-aaaa (dd-mm-yyyy)
is with these line formatTimeStamp(strtotime("15-05-2004"), "s"), formatTimeStamp only accept date in timestamp format, then we needed to turn the date to the format timestamp is what strtotime does, for greater reference see http://mx2.php.net/manual/en/function.strtotime.php, I leave for that needs it and thanks it for its aid.

7
nachenko
Re: function change Date format
  • 2005/4/15 10:19

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


Again this forum, Simpson's Stephen Hawking, saved my life. Thanks.

8
Dynia
Re: function change Date format
  • 2009/7/21 14:51

  • Dynia

  • Just popping in

  • Posts: 3

  • Since: 2009/7/17


how to change date language?

9
anderssk
Re: function change Date format
  • 2009/7/21 18:49

  • anderssk

  • Quite a regular

  • Posts: 335

  • Since: 2006/3/21


Dynia - the tread is 4 years old. Many things has changed

Is it in core you want to change date format ore is it in a module?

10
culex
Re: function change Date format
  • 2009/7/21 22:04

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


Programming is like sex:
One mistake and you have to support it for the rest of your life.

Login

Who's Online

391 user(s) are online (311 user(s) are browsing Support Forums)


Members: 0


Guests: 391


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits