javascript - Change the real time into a given span of time, with jquery, mysql and/or php -


i'm working on rpg chat coded in old php-mysql , javascript (at time there no jquery), , playing story vampires (not twilight style, assure :p).

and need set time watch visible, doesn't have real time, night time, extended throughout day.

for example, @ real time 6 am, must correspond in-game time of 20pm, , on, until real time 5:59am, must correspond in-game time of 5am.

so through whole real-life day, in game time span goes 20pm 5am, night, in short.

is possible? it's ok use php , mysql, or jquery or javascript (even though think easier done last two).

php writing in old procedural style, not object oriented, specify.

thanks replies!

interesting problem. think algorithm go this:

  1. calculate percentage of actual day has passed.
  2. use calculate how time has passed in virtual day (multiply times 32400 number of seconds, probably).
  3. add number of seconds date object has been set 20:00pm on today's date.

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -