Jump to content

PHP YYYY to YY confused


monkeytooth

Recommended Posts

Ok I have a 4 digit year stored in a database column.. I pull it out from the DB and I try to convert it to a 2 digit year. Which at first I thought was working fine.. Then i realized im only returning the current year. in 2 digit format.

 

I though going the route of:

$semister_year= date('y', strtotime($bcinfo1[0]['semister_year']));

would do me some justice but its not

$bcinfo1[0]['semister_year']

Is the year.. coming from the DB.. any ideas? The years range I just want the two last digits..

 

example 2012 to 12

Link to comment
https://forums.phpfreaks.com/topic/201254-php-yyyy-to-yy-confused/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.