This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Change Date Format


avatar
capslock 0
From: -
Change Date Format

Is possible to change the way date and time are displayed?

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Change Date Format
avatar
0
From: -
Change Date Format

my code in php is

$colvalue = date('Y-m-d', mktime (0, 0, 0, $_POST[$colname."_months"], $_POST[$colname."_days"], $_POST[$colname."_years"]));

the output is 2008-01-21

i want it to be displayed as 21-jan-2008
how to change the code for making the change??
somebody pls help me..
1 Re: Change Date Format
avatar
17
From: -
Change Date Format

Just add the following code in the php part of the review_header template (I would imagine that's where you want this)

$insert[review_date] = date("j F, Y",strtotime($insert[review_date])); 


then add $insert[review_date] to the html part, though it should already be there.

Hope that helps.
1 Re: Change Date Format
avatar
OP 0
From: -
Change Date Format

in review.
1 Re: Change Date Format
avatar
Administrator
1340
From: Vienna, Austria
Change Date Format

Yes, this could be done with the templates (see forma's posting)

Where do you like to change the date and to which date format? Please post an example.
1 Re: Change Date Format
avatar
OP 0
From: -
Change Date Format

where do i have to type it?
1 Re: Change Date Format
avatar
17
From: -
Change Date Format

yep

$insert[review_date] = date("j F, Y",strtotime($insert[review_date]));


will change it from 30/08/2005 to 30 August, 2005

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.