Log in

View Full Version : Outputting dates in a format other than "yyyy-mm-dd"?


Quillink
01-27-2010, 05:21 AM
How can I export a column of dates in the format "yyyy-mm-dd" (e.g. 2010-01-27) in a format such as "27 Jan, 2010"?

Thanks again in advance :)

Arianna
01-28-2010, 10:45 AM
I redid the dates to make them use the time() unix timestamp, as you can then echo them as is wished. :D I don't know how to do it that way, but I know there is a way... Just need to remember how. xD

arlecchina
01-28-2010, 07:26 PM
How can I export a column of dates in the format "yyyy-mm-dd" (e.g. 2010-01-27) in a format such as "27 Jan, 2010"?

Thanks again in advance :)


This example comes directly from http://php.net/manual/en/function.date.php

<?php
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone

$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today = date("m.d.y"); // 03.10.01
$today = date("j, n, Y"); // 10, 3, 2001
$today = date("Ymd"); // 20010310
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today = date('\i\t \i\s \t\h\e jS \d\a\y.'); // it is the 10th day.
$today = date("D M j G:i:s T Y"); // Sat Mar 10 17:16:18 MST 2001
$today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:18 m is month
$today = date("H:i:s"); // 17:16:18
?>

Quillink
01-28-2010, 09:49 PM
But will those work with any dates I've recorded or just with the current day?
Meh, I'll test it anyway after I've finished this script. Need to keep my head in one place at a time. :S

arlecchina
01-29-2010, 01:09 AM
But will those work with any dates I've recorded or just with the current day?
Meh, I'll test it anyway after I've finished this script. Need to keep my head in one place at a time. :S


It doesn't have to be today. That's just an example I think. The link has more information. I am not an expert, but that example helped me.

Seapyramid
01-29-2010, 01:21 AM
Quilink .. Contact Zami on PGS when you are fully active again to get promo & get nursery. We had removed the link when you were inactive for so long but nursery is still there when you are ready.

Quillink
01-29-2010, 11:47 AM
Thanks, and I would have removed the link too if I were admin. ;)

I'm really trying hard this time to bottleneck the outgoing images from my site this time. I want to try and avoid clicks from already registered users and try and focus on the potential market. I learnt a lot the last time round (which hereforth will be referred to as "beta 1", lol), mostly that click gathering sites such as Yarolds are not your friend if you're looking to gain users.

I'd like to say I'm not in it for the money, but everyone needs to cover expenses! :)

That's why this time I'm going to go straight to big audiences (MySpace and FaceBook if all goes to plan). I want to get a nice cushion of cash to keep the server going, and my userbase's convieniences have to come second unfortunately.


Woah, I think I went off topic a bit there. My point is that I may or may not register my site to your services. It's nothing personal, just that paying $200 a month is never fun so I'd like to reduce the expenses as much as I can. ;)