Jump to content

change the number 2006 into 06


jwk811

Recommended Posts

how about getting the last two digits in a sentence.. because i just relized that i store the date like this: January 14, 2006. How could I make it so it gets just the last two without knowing how many are in the string? Would I have to do a string count and subtract the difference? if thats the way to do it could you help me with that? im not too sure on how to do that either.. thanks!
Link to comment
Share on other sites

If you are storing the date in a database, you really should be storing it as a "date" type field. Tell us what you're using to format the date now.

If you store it as a "date" field, you can always display it however you want.

Ken
Link to comment
Share on other sites

nevermind forget about that part i got it.. i process it before it enters the data base and its separated then.. so i got that thanks.. that seems like a better idea to use a date row instead.. how could i put it into the db when in parts like there will be a select form for the month day and month how can you combine it to fit into the db in the date row? and how could i take it out so its set up like January 14, 2006? thanks for you help!
Link to comment
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.