473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

current time minus the submitted time

im making a mini attendance module, but i dont have a idea to do this so please help me and the user must attend every 3hrs so if they attend at 3:05 the difference from time will be the value of $late so its the 5 minutes

this is my code of getting the time to show in the page

Expand|Select|Wrap|Line Numbers
  1. var currentTime = new Date()
  2. var hours = currentTime.getHours()
  3. var minutes = currentTime.getMinutes()
  4. if (minutes < 10){
  5. minutes = "0" + minutes
  6. }
  7. document.write(hours + ":" + minutes + " ")
  8. if(hours > 11){
  9. document.write("PM")
  10. } else {
  11. document.write("AM")
  12. }
so im planning to get the time into the database by using this query

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO time_in(late,time_in)
  2.         VALUES ('$late,NOW())";
and my big problem is how can i get the difference from time required to they time attend and inserted into my database
Feb 8 '17 #1
0 1027

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dan glenn | last post by:
Say, I want to set a cookie and have it expire an hour after it's set. It's looking like this is only possible for browsers which are in the same time zone as my server?? In other words, if I...
17
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the...
8
by: peterbe | last post by:
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to...
7
by: mekim | last post by:
Hi All, is there a webservice for get the current time? I am looking to get the current time via a webservice and then set the time of the server. Regards, Mekim
7
by: Brett Edman | last post by:
I created a UTC clock using this: UTCTime = MyTime.ToUniversalTime() Now that we've turned the clocks ahead 1 hour for daylight savings time, the clock is reporting the wrong UTC time. It is...
4
by: Gary Wessle | last post by:
Hi I am not getting current time with this program, what am I doing wrong? #include <ctime> #include <iostream> using namespace std; #define P(x) cout << #x " = " << (x) << "\n";
17
by: Andrew Chalk | last post by:
Network time uses 1900 as its base. The C time library uses 1970. I want to convert a network time value to a C library time. I.e. I have to subtract the number of seconds from 1900 to 1970. Is...
6
by: jehugaleahsa | last post by:
Hello: I would like it so that the time displayed was always for CDT/CDS. Potentially, the application can be run at locations in Mountain Time or Central Time. This is what I have now: //...
0
by: Eric Wertman | last post by:
Sorry, my time zone is +4, not minus 4, which means that something else is causing my source data to be in the future. I still do need to understand where the time routines determine the time zone...
4
by: Matt.Russett | last post by:
Hello, Here is what I am trying to do. I am running a report that brings back Requested Pick-Up Times and Actual Pick-Up Times. What I want to measure is the amount of times the Requested...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.