Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:17:22+00:00 2026-05-16T11:17:22+00:00

I have a report which will give me the time field as $time=’Wed, 25

  • 0
  1. I have a report which will give me the time field as $time='Wed, 25 Aug 2010 13:43:38 +0000'. I am currently storing this into my MySql DB exactly like this and generating a custom report with the same time. I am in EST time so i want to know how i can change the $time field to show it according to 'Wed, 25 Aug 2010 09:43:38 '. i want to remove that +0000 and change the timings to EST. I want to store it into the DB in this format, which i saved as a varchar.

  2. I also want to be able to split this $time and save it as $timeday='Wed, 25 Aug 2010' and $timetime='09:43:38'. splitting it by counting the no of characters might work but problem would arise when it is like Wed, 9 Aug 2010 or if i get the report time as Wed, 1 Sept 2010, which i am not sure whether the month would always be 3 characters or can change.

Thank you 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:17:22+00:00Added an answer on May 16, 2026 at 11:17 am

    First off, never store a datetime as varchar. You just made it completely useless. Always store it in a special datetime format. This way you can do all sorts of things, searching, sorting etc.

    When you need to recover your information you can format the output in anyway you want. You can also subtract just the parts you need when requesting from the database.

    See: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

    To store your data in the correct way.

    Use string to time, and then format it into mysql datetime format.
    Postgresql supports timezone, if I’m correct mysql does not. So you can create a function when requesting the data from the database to display it anyway you need.

    Make sure you have set a default timezone in php or else you will get an error.

    Store into mysql database
    You first create correct mysql format:
    // http://php.net/manual/en/function.strtotime.php

    $db_date_timestamp = strtotime('Wed, 25 Aug 2010 13:43:38');
    $db_date = date('Y-m-d H:i:s', $db_date_timestamp);
    

    When requesting from database you can use the database to format it in anyway you need.
    example (mysql):

    SELECT DATE_FORMAT(‘2009-10-04
    22:23:00’, ‘%W %M %Y’);
    -> ‘Sunday October 2009’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have a report which has grouping on the underlying data
I have a Crystal Report which is viewed via a CrystalReportViewer control on an
I have a RDLC report which has a table, calling a subreport N times.
I have a crystal report function which requires me to trim off characters which
I have an SQL reporting server report which has 5 parameters which permit nullable
in .net I have created an excel report which takes a datagrid's render output
I have a few Munin plugins which report stats from an Autonomy database. They
I have a report, which was recently converted from SSRS2005 to SSRS2208. The report
I have built a web page which contains a Crystal Report built using the
We have a reporting server which has a bunch of reports and some ad

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.