Jump to content

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

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.