troubleshooting Question

Changing timestamps in a mysql query

Avatar of MeridianManagement
MeridianManagementFlag for United States of America asked on
DatabasesMySQL ServerSQL
8 Comments1 Solution611 ViewsLast Modified:
So there's a table called content. In that table there's a status, article, and timestamp field. For all articles of status zero, I would like the first half to have the current time stamp, and then for every three, add another half hour. Then, after 8 hours, if there are any articles left, publish the bulk of them at 8 and a half hours. And they need to be in this format: 2006-11-28 06:56:00

So in pseudo code, it would be like this....

count = num all articles
for all articles where row < count/2, article = current time stamp.
starting at article where row = count/2, article = currenttime stamp + half hour
repeat twice
article = current time stamp + hour
repeat twice
article = current time stamp + hour and half
repeat twice
then all of the rest of the articles = current time stamp + 8 and a half hours
Aleksandar Bradarić
Software Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros