Date/Time

10 posts by 2 authors in: Forums > CMS Builder
Last Post: August 17, 2009   (RSS)

By design9 - August 6, 2009

Hello,

I am importing some old articles into the system and some of my articles are dated back to 2005, 2006 etc. I noticed that the date/time field only goes back to 2008. Is there anyway to change this so I can have 2005 and up?

Also, when I imported the articles in...the date never went in and it defaulted all the articles to jan 1, 2008. This is not as important but is there a way to make it show the dates that I imported into the database?

Thanks!

April

Re: [chris] Date/Time

By design9 - August 6, 2009

Hi Chris,

I am using the "created" system field. Is there a way to adjust that?

For the import, all the old data was in a asp database (they are moving to php). I exported all of that data out into a csv file, updated my csv file to reflect my columns, etc. in the cms_articles table in the php database and then imported the csv file into the php databse. I use a software called SQL manager for MYSQL to import my data into the database.

Thanks!

April

Re: [apdance9] Date/Time

By design9 - August 10, 2009


Re: [apdance9] Date/Time

By Chris - August 11, 2009

Hi apdance9,

CMS Builder uses the MySQL DATETIME field type for created fields, which supports a range of '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. I suspect something went wrong with your import. Perhaps you got the format of the date wrong? Can you post an example line from your CSV file?
All the best,
Chris

Re: [chris] Date/Time

By design9 - August 17, 2009

That must be the problem. In my csv file, this is how the date time appears: 1/1/2006 0:00

So, do I need to change them so they display: 2006-01-01 00:00:00 ?

Also, can you tell me how I can I can change the dates in the date/time field in the backend to go back to at least 2005? Currently the selection is only 2008 and greater.

Thanks!

April

Re: [apdance9] Date/Time

By Chris - August 17, 2009

So, do I need to change them so they display: 2006-01-01 00:00:00?


Yes, that's correct. There are a variety of ways to do this. The simplest is to open your file in a spreadsheet editor (e.g. Excel) and change the format of your date column.

Currently the selection is only 2008 and greater.


Which field(s) have this limitation on what dates can be selected?
All the best,
Chris

Re: [chris] Date/Time

By design9 - August 17, 2009

It is the standard date/time field (with cms) that I am using. It will only go to 2008. I need to import some old articles that have dates of 2005, 2006 and 2007. Can I change this to to go back to 2005 and greater?

Thanks!

April

Re: [apdance9] Date/Time

By Chris - August 17, 2009

Hi April,

As I mentioned earlier in this thread, in the field editor, it is possible to adjust the Year Range of a "date/time" field to handle dates before 2008.

Admin > Section Editor > modify your section > modify your date/time field. The very first option there is "Year Range".
All the best,
Chris

Re: [chris] Date/Time

By design9 - August 17, 2009

Thank you...the only issue I am having is that in my excel or csv file when I go in to change the date format (I changed the cell fomat date to yyyy-mm-dd 00:00:00) and it appears fine but then when I save it, it reverts back to the old date formatting. Not sure if this is even something you could help with but wanted to ask.

Thanks!