Time-stamp Calculations

 

Please click on particullar buttons to run JavaScripts.
I don not want to bore you with auto-running scripts.

 

Some datums:

Description:
Human Form
Machine Form
Actual time-stamp:
-
-
One hour in advance:
One day in advance:
One week in advance:
One month in advance:
One year in advance:
-
-
End of actual hour:
End of actual day:
End of actual week:
End of actual month:
End of actual year:
    1. Please note, that for simplicity, the moth usually means 30 days - no matter how many days the actual month has in gregorian calendar. The same about year - it is usually 365 days long. At "economic" calculations is sometimes 360 days, as 12 months per 30 days.
    2. I supposse, that Sunday is end of the week, as it is usual at Europe mainland and defined at ISO 8601.
    3. Machine form can be shortened by server to seconds! So you will get just 10 digits (instead 13) and you will have to add 000 (three zeros) to end.

 

da-tum (day'tuhm, dat'uhm, dä'tuhm) n. pl. <da-ta>(day'tuh, dat'uh, dä'tuh) for 1-3 <da-tums> for 4

    1. a single piece of information, as a fact, statistic, or code; an item of data.
    2. a. any proposition assumed or given, from which conclusions may be drawn.
    3. Survey., Civ. Eng. any level surface, line, or point used as a reference in measuring elevations.
    4. [1640-50; < Latin: a thing given, neut. ptp. of dare to give]

Random House Webster's Electronic Dictionary and Thesaurus


Find the next Java's time-stamp period finish:

Time-stamp:
... or paste 13 digits from cookie 
Nearest at:

period  
Period definition:
Period start:
 
 
Start of desired interval:
which is:
Period length :
ms  
Result:
which is:

There can be one potential problem with a specially weeks interval. It is the most convenient to simply floor time-stamp value with interval of 7 days. The most pages do it that way and ignore the fact that 1970-01-01 is Thursday. Some pages corrects value (it is simple substract). Only a few, but the most popular pages, reset week counting every year. I have never saw a page which counts a weeks according ISO 8601 - the first week of year must contain the 4th of January and week starts at Monday.
This calculator does the same - as default it starts counts interval from JE datum. However, you can change this behaviour to reset on the beginning of the year, or to midnight, etc. - depend on context.


Java's time-stamp converter:

Actual time-stamp:
 
 
-
 
-
 
Time-stamp:
UTC
 
-
 
-
 
Local Time:
JEms
   
convert check >>>
UTC

Please note, that JEms means "Java Era" miliseconds. Enter 0 (zero) to time-stamp and convert it - you should get Thursday 1970-01-01 midnight of CET.

 


Java's time-stamp calculation with time:

Time-stamp:
 
Operation to perform:

 Substract:

Time interval:
 
 
 
Start at time-stamp:
which is:
Miliseconds to add:
   
Result:
which is:

 


This page is demonstration playground to my "Cookies" tutorial, published as a part of Net Transport Training Area.

You can translate or link this tutorial under conditions written at this domain's "Legal Stuff" page and followed. If any doubts, please contact me.

Copyrights, trademarks and credits are collected here.

Marián Stach
Prešov, Slovakia Central Europe
2004-07-26

[ Language ] :: [ Main Index ] :: [ Site Navigation ] :: [ Tutorials ] :: [ Downloads ] :: [ Contact ]