Author Topic: Comparing two times  (Read 1204 times)

0 Members and 1 Guest are viewing this topic.

Offline WooshMan

  • Fulll Member
  • ****
  • Posts: 53
  • Karma: +0/-0
Comparing two times
« on: 10 February, 2004, 16:51:41 »
Hi,

I have a time HH:MM:SS in a table against a user and would like to know how many minutes difference is between the time in the table and the current time.

I have both times in variables but cannot work out how to compare them and get the number of minutes difference.

-- current time --
s,e,thours,tmin,tsecs = strfind(date("%X"),"(%d+):(%d+):(%d+)")

-- time in table --
   s,e,hours,min,secs = strfind(tban[user.sName],"(%d+):(%d+):(%d+)")

Please help

Thanks :-)

Woosh
WooshMan

Creator of
originaltimebot.lua
www hubstats

Thanks to Plop, Kepp and NightLitch

PtokaX forum

Comparing two times
« on: 10 February, 2004, 16:51:41 »

Offline NotRabidWombat

  • Lord
  • ***
  • Posts: 384
  • Karma: +2/-0
(No subject)
« Reply #1 on: 11 February, 2004, 06:29:43 »
You'll want to read up on Julian dates and then use one of the code examples from here:
http://board.univ-angers.fr/thread.php?threadid=617&boardid=6


I like childish behavior. Maybe this post will be deleted next.

Offline WooshMan

  • Fulll Member
  • ****
  • Posts: 53
  • Karma: +0/-0
(No subject)
« Reply #2 on: 11 February, 2004, 10:51:03 »
Thanks NotRabidWombat

Will do :-)
WooshMan

Creator of
originaltimebot.lua
www hubstats

Thanks to Plop, Kepp and NightLitch

PtokaX forum

(No subject)
« Reply #2 on: 11 February, 2004, 10:51:03 »