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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:02:18+00:00 2026-06-08T11:02:18+00:00

How should I save the pc’s time (not server time) in a PHP variable?

  • 0

How should I save the pc’s time (not server time) in a PHP variable?
I tried

$a='<script type="text/javascript"> document.write(Date()) </script>';

without luck

  • 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-08T11:02:21+00:00Added an answer on June 8, 2026 at 11:02 am

    The only way to do that would be to send it to the PHP script via a form or query. All the PHP is executed on the server and sent out to whoever requested it. The PC time would have to be sent back to the server for it to know what it is.

    Edit: If you want to just use javascript to show the current PC time you can echo out this in your code:

    <script language="javascript">
    <!--
      var today = new Date();
      document.write(today);
    //-->
    </script>
    

    In PHP it would be:

    $timeString='
    
    <script language="javascript">
    <!--
      var today = new Date();
      document.write(today);
    //-->
    </script>
    ';
    echo $timeString;
    

    It would show up as Thu Jul 26 2012 00:17:43 GMT+1000 (EST) on the client PC. Here is a link to a decent tutorial on how to use javascript to display dates, times and all sorts of other goodies based on the users PC.

    Edit 2: This Javascript will display the date and time nicely.

    <script type="text/javascript">
    <!--
    var d = new Date();
    var curr_date = d.getDate();
    var curr_month = d.getMonth();
    curr_month++;
    var curr_year = d.getFullYear();
    var curr_hour = d.getHours();
    var curr_min = d.getMinutes();
    document.write(curr_month + "/" + curr_date + "/" + curr_year + " - " + curr_hour + ":" + curr_min);
    //-->
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this program in Python which should save text files to a folder
I have a small issue with a method that should save the text contained
My aim is to write an intelligent ChatBot. He should save known informations likely
Hey I try to write a littel bash script. This should copy a dir
hey there i have this code that should save a file from sql server
I would like to know where I should save my .sbclrc file. I tried
I am looking for where I should save my app stuff, and after a
Yesterday I asked the question on how I should save my files. After some
I am creating a Spring MVC Hibernate application using MySQL. Where should I save
Should I use NHibernate Collection Cascading to perform collection save-updates, or should I use

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.