DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Date manipulation

  1. #1
    saajid Guest

    Date manipulation


    Hi,

    I have developed an application with VB6.0 and access and its working fine.
    But the problem is date .If the system date format is different from the
    format which i developed for,its gives wrong date manipulation.

    Tried with format funtion.The problem with the format function is that it
    also works according to the system date format.

    for eg:

    if the system date format is dd/mm/yyyy then the function

    s=format(d,"dd-mmm-yyyyy") will give an output which is diffrent when
    the system date format is mm/dd/yyyy.

    Hope you got the problem clearly and solution too...

    Thanks in advance












  2. #2
    Rick Rothstein Guest

    Re: Date manipulation

    As long as your user knows what his/her local settings are,
    there is no problem. Just use the Month function on what
    he/she enters to retrieve the Month, the Year function to
    retrieve the Year and the Day function to retrieve the Day.
    You can then arrange these internally in whatever
    combination you want to form a date consistent with your
    needs.

    Rick


    "saajid" <saajid75@yahoo.com> wrote in message
    news:3cd8aec1$1@10.1.10.29...
    >
    > Hi,
    >
    > I have developed an application with VB6.0 and access and

    its working fine.
    > But the problem is date .If the system date format is

    different from the
    > format which i developed for,its gives wrong date

    manipulation.
    >
    > Tried with format funtion.The problem with the format

    function is that it
    > also works according to the system date format.
    >
    > for eg:
    >
    > if the system date format is dd/mm/yyyy then the function
    >
    > s=format(d,"dd-mmm-yyyyy") will give an output which is

    diffrent when
    > the system date format is mm/dd/yyyy.
    >
    > Hope you got the problem clearly and solution too...
    >
    > Thanks in advance
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >



  3. #3
    Guest

    Re: Date manipulation


    Hi,

    How to get the date format of local settings?
    On the Dateadd function if we add 1 month ,30 days are getting added.

    For eg:

    If we add 1 month to the date(28-feb-2003) then the date that we get is 29
    march .How to get the correct next end month.

    Thanks in advance




    "Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote:
    >As long as your user knows what his/her local settings are,
    >there is no problem. Just use the Month function on what
    >he/she enters to retrieve the Month, the Year function to
    >retrieve the Year and the Day function to retrieve the Day.
    >You can then arrange these internally in whatever
    >combination you want to form a date consistent with your
    >needs.
    >
    >Rick
    >
    >
    >"saajid" <saajid75@yahoo.com> wrote in message
    >news:3cd8aec1$1@10.1.10.29...
    >>
    >> Hi,
    >>
    >> I have developed an application with VB6.0 and access and

    >its working fine.
    >> But the problem is date .If the system date format is

    >different from the
    >> format which i developed for,its gives wrong date

    >manipulation.
    >>
    >> Tried with format funtion.The problem with the format

    >function is that it
    >> also works according to the system date format.
    >>
    >> for eg:
    >>
    >> if the system date format is dd/mm/yyyy then the function
    >>
    >> s=format(d,"dd-mmm-yyyyy") will give an output which is

    >diffrent when
    >> the system date format is mm/dd/yyyy.
    >>
    >> Hope you got the problem clearly and solution too...
    >>
    >> Thanks in advance
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >



  4. #4
    Arthur Wood Guest

    Re: Date manipulation


    YOu are mis-interpretting what the dateadd function "ADDS". when you add
    1 MOnth, what is actually happening is that the MONTH NUMBER is incremented
    by 1, so dateadd("m",1,#28-Feb-2002#) will result in 28-Mar-2002 (Feb + 1
    ) = Mar. DateAdd does NOT add 1 calendar month to the date, it simply increases
    the Month PART of the Date by 1.

    Arthur Wood



    <vb.@127.0.0.1> wrote:
    >
    >Hi,
    >
    >How to get the date format of local settings?
    >On the Dateadd function if we add 1 month ,30 days are getting added.
    >
    >For eg:
    >
    >If we add 1 month to the date(28-feb-2003) then the date that we get is

    29
    >march .How to get the correct next end month.
    >
    >Thanks in advance
    >
    >
    >
    >
    >"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote:
    >>As long as your user knows what his/her local settings are,
    >>there is no problem. Just use the Month function on what
    >>he/she enters to retrieve the Month, the Year function to
    >>retrieve the Year and the Day function to retrieve the Day.
    >>You can then arrange these internally in whatever
    >>combination you want to form a date consistent with your
    >>needs.
    >>
    >>Rick
    >>
    >>
    >>"saajid" <saajid75@yahoo.com> wrote in message
    >>news:3cd8aec1$1@10.1.10.29...
    >>>
    >>> Hi,
    >>>
    >>> I have developed an application with VB6.0 and access and

    >>its working fine.
    >>> But the problem is date .If the system date format is

    >>different from the
    >>> format which i developed for,its gives wrong date

    >>manipulation.
    >>>
    >>> Tried with format funtion.The problem with the format

    >>function is that it
    >>> also works according to the system date format.
    >>>
    >>> for eg:
    >>>
    >>> if the system date format is dd/mm/yyyy then the function
    >>>
    >>> s=format(d,"dd-mmm-yyyyy") will give an output which is

    >>diffrent when
    >>> the system date format is mm/dd/yyyy.
    >>>
    >>> Hope you got the problem clearly and solution too...
    >>>
    >>> Thanks in advance
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center