Jump to content

Recommended Posts

Well, I'm not sure about what you're looking for, but here's

a small example about how to format the current date like that.

 

<?php

$year = date("Y");
$month = date("m");

$year_formated = $year[2] . $year[3];

if($month == "01"){$month_formated = "Jan";}
if($month == "02"){$month_formated = "Feb";}
if($month == "03"){$month_formated = "Mar";}
if($month == "04"){$month_formated = "Apr";}
if($month == "05"){$month_formated = "May";}
if($month == "06"){$month_formated = "Jun";}
if($month == "07"){$month_formated = "Jul";}
if($month == "08"){$month_formated = "Aug";}
if($month == "09"){$month_formated = "Sep";}
if($month == "10"){$month_formated = "Oct";}
if($month == "11"){$month_formated = "Nov";}
if($month == "12"){$month_formated = "Dec";}

$date_formated = $month_formated . "-" . $year_formated;

echo $date_formated;

// THERE YOU GO, YOU HAVE THE DATE FORMATED LIKE THAT IN THE date_formated VARIABLE

?>

 

I hope it helps you out somehow.

If you need more help, just send me a message.

Link to comment
https://forums.phpfreaks.com/topic/188391-date-field/#findComment-995071
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.