Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Perl "days in the future"

Perl "days in the future"

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
perljsontutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m holliday
    wrote on last edited by
    #1

    I need to determine, for an events scheduling app, what days in the future are... As an example, someone may want to schedule an event for Sat, Jan. 30th, 2010, and every Saturday for the following 8 weeks... Got the rest of it working, just need a way to take an input field of "20100130", feed it into "perl date routine" and add to/loop thru to get my dates... I've looked around, seems like date::manip has what I want, but I'm not sure I'll be able to get that installed... does anyone know of a way to do this with "localtime"? I have searched extensively, can't find any instances of parms fed to localtime EXCEPT when it's adding time to today, etc... I need to first establish my date, by converting it from an input field, then adding to the result... sounds pretty simple, but I am not getting anywhere... and I'd be fine with a reference to read, if I've missed something... please forgive the clutter to this great board if I missed this somewhere.... thanks M. Holliday

    G 1 Reply Last reply
    0
    • M m holliday

      I need to determine, for an events scheduling app, what days in the future are... As an example, someone may want to schedule an event for Sat, Jan. 30th, 2010, and every Saturday for the following 8 weeks... Got the rest of it working, just need a way to take an input field of "20100130", feed it into "perl date routine" and add to/loop thru to get my dates... I've looked around, seems like date::manip has what I want, but I'm not sure I'll be able to get that installed... does anyone know of a way to do this with "localtime"? I have searched extensively, can't find any instances of parms fed to localtime EXCEPT when it's adding time to today, etc... I need to first establish my date, by converting it from an input field, then adding to the result... sounds pretty simple, but I am not getting anywhere... and I'd be fine with a reference to read, if I've missed something... please forgive the clutter to this great board if I missed this somewhere.... thanks M. Holliday

      G Offline
      G Offline
      Graham Breach
      wrote on last edited by
      #2

      Try POSIX::mktime() - you can use that to turn dates and times into a time_t, then add N weeks worth of seconds and turn it back using localtime().

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups