Results 1 to 5 of 5

Thread: Time Event Sort Of Thing

  1. #1
    Join Date
    Jul 2011
    Posts
    56
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Time Event Sort Of Thing

    I've been experimenting a lot with trying to find the right "formula" for having the user's character work for a certain amount of time and then the user is done working. If you have any ideas for making a script for this?

    Thanks!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You'll have to give us more information. You can store time in a database and add time as needed, then change some status information once you reach a certain level. But beyond that, we'll need to know a lot more about your site.
    Daniel - Freelance Web Design | <?php?> | <html>| espaņol | Deutsch | italiano | portuguęs | catalā | un peu de franįais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jul 2011
    Posts
    56
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Well let's say for example the user will work for 8 hours. What would be the best method for getting the time plus the eight hours. When the user logs in, the page would check if the current time is the same or greater than the work time. The work time script would need to take into consideration the changing of years and the time going past midnight.

    Hope that gives a better idea of what I need some help with!

    Thanks!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    If you work with timestamps, none of that is a problem. Just use basic math (addition and/or subtraction) then convert them to readable dates later.
    https://www.google.com/search?q=work...h+dates+in+php

    If you want someone to build this for you, you should post in the paid work requests area. You can probably do this yourself if you aren't in a big hurry. Just take it one step at a time, and it should work. It's not especially difficult to work with time once you understand it, and it doesn't take that long to learn.
    Daniel - Freelance Web Design | <?php?> | <html>| espaņol | Deutsch | italiano | portuguęs | catalā | un peu de franįais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jul 2011
    Posts
    56
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Thanks for getting me started! I believe I got a usable script I came up with!

    Thanks again, can't believe I just should of thought of searching "working with dates in php".

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •