Jump to content

Calculating time


villr

Recommended Posts

The thing that im trying to do and what im gonna have it to is like this, it will be a bot that says like, it was 1day and 3 hours since you last visited here. or it was 5 hours since you last visited here

I have some code i tested but i wasent even sure what i was doing but here it is..

TD2 = tonumber(20130615) 
OD2 = tonumber(20130610) 
hDays = (TD2-OD2) 
totH = hDays*24 
curH = totH/h 
outputChatBox(hDays.." days, "..curH.." hours  "..(totH).." total hours") 

Anyone know how to do it?

Link to comment

What i meant with my post was, im going to have an thing in Area51 that will say when you enter, it was 5hours since you last visited here, or, it was 1 day and 5 hours since you last visited here.

The time will be calculated from a data that has been saved as example 2013 06 14 22 10 but im not sure how i should calculate this, i only know how to calculate the days and total hours

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...