Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Date - formatting

    I'm needing to assign the following variable with the following data from
    the date. Does anyone have any help they could offer please?

    date_day = the current day number I.E 21
    date_month = the current month I.E july
    date_year = the current year I.E 2003

    I also need the following variable for 10 days later

    date_day2 =
    date_month2 =
    date_year2 =

    Any help is much appreciated


    Andrew Banks Guest

  2. Similar Questions and Discussions

    1. Date Formatting
      Use the Day function. response.write day("12/1/2003") Of course, is that date the first of December, or the twelth of January? I suggest you...
    2. Date Formatting Error
      I'm experiencing an anomaly with ColdFusion when formatting a string variable as a date at the moment Daylight Savings Time happens. I set a string...
    3. formatting date() and nbsp;
      What I have is a date that I'd like to format to keep it together on one line using non-breaking spaces. I started with: date...
    4. formatting date
      On 30/7/03 2:18 PM, in article bg7guu$b7j$1@forums.macromedia.com, "JemJam" <webforumsuser@macromedia.com> wrote: The systemDate object will...
    5. Date Formatting Issue
      I have Access 2000. On a form, I want to show (in an unbound text box) how long an agreement has been effect, and format it in years and days. ...
  3. #2

    Default Re: Date - formatting

    Andrew Banks wrote:
    > I'm needing to assign the following variable with the following data from
    > the date. Does anyone have any help they could offer please?
    >
    > date_day = the current day number I.E 21
    > date_month = the current month I.E july
    > date_year = the current year I.E 2003
    >
    > I also need the following variable for 10 days later
    [url]http://www.php.net/date[/url]


    --
    ----- stephan beal
    Registered Linux User #71917 [url]http://counter.li.org[/url]
    I speak for myself, not my employer. Contents may
    be hot. Slippery when wet. Reading disclaimers makes
    you go blind. Writing them is worse. You have been Warned.

    stephan beal Guest

  4. #3

    Default Re: Date - formatting

    thanks stephan. I've got the first bit working ok but having problems
    getting to grips with mktime() for adding 10 days to the date.

    Cany you help here please?

    "stephan beal" <stephan@wanderinghorse.net> wrote in message
    news:bfgirj$v72$1@ork.noris.net...
    > Andrew Banks wrote:
    >
    > > I'm needing to assign the following variable with the following data
    from
    > > the date. Does anyone have any help they could offer please?
    > >
    > > date_day = the current day number I.E 21
    > > date_month = the current month I.E july
    > > date_year = the current year I.E 2003
    > >
    > > I also need the following variable for 10 days later
    >
    > [url]http://www.php.net/date[/url]
    >
    >
    > --
    > ----- stephan beal
    > Registered Linux User #71917 [url]http://counter.li.org[/url]
    > I speak for myself, not my employer. Contents may
    > be hot. Slippery when wet. Reading disclaimers makes
    > you go blind. Writing them is worse. You have been Warned.
    >

    Andrew Banks Guest

  5. #4

    Default Re: Date - formatting

    "Andrew Banks" <banksy@blablablablueyonder.co.uk> wrote:
    > "stephan beal" <stephan@wanderinghorse.net> wrote:
    >> Andrew Banks wrote:
    >>
    >> > I'm needing to assign the following variable with the following data
    > from
    >> > the date. Does anyone have any help they could offer please?
    >> >
    >> > date_day = the current day number I.E 21
    >> > date_month = the current month I.E july
    >> > date_year = the current year I.E 2003
    >> >
    >> > I also need the following variable for 10 days later
    >>
    >> [url]http://www.php.net/date[/url]
    > thanks stephan. I've got the first bit working ok but having problems
    > getting to grips with mktime() for adding 10 days to the date.
    >
    > Cany you help here please?
    Hi Andrew,

    Alternatively you could use strtotime(), e.g.:

    $tenDaysAgo = strtotime("-10 day");
    $day10DaysAgo = date("d". $tenDaysAgo);

    HTH;
    JOn
    Jon Kraft Guest

  6. #5

    Default Re: Date - formatting

    dont know what the first bit is but -

    $now=mktime();
    $tendayslater=$now+4521252; (this is not a real number but the number of
    seconds in 10 days ie 10x24x60x60)

    bye
    "Andrew Banks" <banksy@blablablablueyonder.co.uk> wrote in message
    news:AmQSa.1286$iY2.12562590@news-text.cableinet.net...
    > thanks stephan. I've got the first bit working ok but having problems
    > getting to grips with mktime() for adding 10 days to the date.
    >
    > Cany you help here please?
    >
    > "stephan beal" <stephan@wanderinghorse.net> wrote in message
    > news:bfgirj$v72$1@ork.noris.net...
    > > Andrew Banks wrote:
    > >
    > > > I'm needing to assign the following variable with the following data
    > from
    > > > the date. Does anyone have any help they could offer please?
    > > >
    > > > date_day = the current day number I.E 21
    > > > date_month = the current month I.E july
    > > > date_year = the current year I.E 2003
    > > >
    > > > I also need the following variable for 10 days later
    > >
    > > [url]http://www.php.net/date[/url]
    > >
    > >
    > > --
    > > ----- stephan beal
    > > Registered Linux User #71917 [url]http://counter.li.org[/url]
    > > I speak for myself, not my employer. Contents may
    > > be hot. Slippery when wet. Reading disclaimers makes
    > > you go blind. Writing them is worse. You have been Warned.
    > >
    >
    >

    Mike Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139