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

  • Home
  • SEARCH
  • 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 6051813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:51:33+00:00 2026-05-23T07:51:33+00:00

Hello I have this string that will generate the time that I then insert

  • 0

Hello I have this string that will generate the time that I then insert in the db

$time=mktime(date('G'),date('i'),date('s'));
$NowisTime=date('Gis',$time);

Now I need to readd colons to this string: :

I need it to be generated and inserted without colons, but shown in another place with colons reinserted, so that it will look like this:

13:24:09

Instead of:

132409

The same is for $todaydate = date('Ymd');

That should become then 2011-06-16

How can I do that?

Counting the words is not good, since we can have more or less types depending by the actual time and date.

Please advise

Thank you!

FOR WHO DOES NOT UNDERSTAND: this values are taken from the DB so I cannot use : date(‘Y-m-d’); in a values taken from the db……..

  • 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-23T07:51:33+00:00Added an answer on May 23, 2026 at 7:51 am

    The same is for $todaydate =
    date(‘Ymd’);

    That should become then 2011-06-16

    For this one, try :

    date('Y-m-d');
    

    Similar for your Other part.

    Edit ::
    For Date :

    $time = “time from database”;
    $unixtimestamp = strtotime ( $time) ;
    $date = date(‘Y-m-d’, $unixtimestamp);

    For time :

    $time = strtotime("time from database"); 
    $yourtime = date("H:i:s", $time);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have this string: s = '<p>Hello!</p>' When I pass this
Let's say I have this string: Hello &, how are you? I'm fine! Is
Suppose I have this code: String encoding = UTF-16; String text = [Hello StackOverflow];
I have a textbox where a user puts a string like this: hello world!
I have a string containing something like this Hello bla bla bla bla ok,
I have a string, such as this: $foo = 'Hello __(How are you) I
I have a string as const char *str = Hello, this is an example
Hello I have this list that i am working on. When i move the
I have a piece of code that will take a string and repeat it
I have an input string that will follow the pattern /user/<id>?name=<name> , where <id>

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.