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 8360115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:21:47+00:00 2026-06-09T11:21:47+00:00

i put date in mysql database with this method 2012-08-02 02:20:05 . now, how

  • 0

i put date in mysql database with this method 2012-08-02 02:20:05. now, how to print in my page using smarty.

mycode : ( NOTE: send_date is name of row )

$sql = "SELECT m.*, s.photo, s.gender
       FROM mail AS m, signup AS s
       WHERE m.receiver = '" .mysql_real_escape_string($username). "'
       AND m.sender = s.username AND inbox = '1' AND status = '1'
       ORDER BY send_date DESC LIMIT " .$limit;
$rs  = $conn->execute($sql);
  • 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-06-09T11:21:49+00:00Added an answer on June 9, 2026 at 11:21 am

    To convert a date from 2012-08-02 02:20:05 to unix epoch (seconds since 1970), you want to use strtotime(). To format an epoch to any human readable date you want to use date() or strtotime().

    Smarty knows the date_format modifier. Since Smarty3 this puppy accepts pretty much anything that represents a date (including 2012-08-02 02:20:05). In Smarty2 you might need to convert the string to epoch yourself, something like {$date|strtotime|date_forma:”%d.$m.%Y”}. Note that since Smarty3 date_format accepts format notations from strtotime and date, while Smarty2 only supported the strtotime notation.

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

Sidebar

Related Questions

PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
I’m using C# and WinForms to try and put just the date from a
I'm trying to extract a date field from a mysql db using .NET and
I want to put the uses date of birth into the database..so I wrote
I have to put my database's data in this format (values will differ, obviously),
Using CakePHP 1.3 I'm trying to save some data to a MySQL database. The
I have this code, that uses mysqldump to backup mysql database. The problem is
I'm using PHP & MySQL to go into a database and change the value
How to put the current datetime in MySQL using PHP? The result should be:
I use httpService to load data from mysql database. I put event.result on arraycollection.

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.