Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    184
    Thanks
    140
    Thanked 0 Times in 0 Posts

    Change of date format (yyyy-mm-dd) from DB into dd/mm/yyyy

    Hello,

    I really need the help of the experts and gurus on here because I really need your help with a date and time format issue.

    Firstly, what is happening is that I am entering the correct date date format of dd/mm/yyyy into my input textbox. Ex. 01/04/2014 (April 1, 2014)

    Secondly, I am writing that value from the input textbox into my MDB database: dd/mm/yyyy. Ex. 01/04/2014

    Thirdly it seems that my MBD is automatically re-arranging my date of dd/mm/yyyy into yyyy-mm-dd (US standard)

    So that when I retrieve the raw date from my mdb I get a long date of: Sat Jan 4 00:00:00 EST 2014

    I guess I would need a javascript function that would take the long date, convert it to yyyy/mm/dd then re-organize the string to dd/mm/yyyy (UK standard)

    Any help on this is greatly appreciated.

    Thanks

    Jay

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,105
    Thanks
    23
    Thanked 594 Times in 593 Posts
    Code:
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta charset="UTF-8" />
    <title>Title of the document</title>
    </head>
    
    <body>
    <div id="dategoeshere"></div>
    
    <script type="text/javascript">
    var workwith = "Sat Jan 4 00:00:00 EST 2014";
    var words = workwith.split(" ");
    workwith = words[5]+" "+words[1]+" "+words[2]
    
    document.getElementById("dategoeshere").innerHTML = workwith;
    </script>
    </body>
    </html>
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    jason_kelly (04-05-2014)

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    184
    Thanks
    140
    Thanked 0 Times in 0 Posts
    Thanks for this Sun,

    But I am getting a split error vardate does not support user defined properties.

    Im not sure why?

    It looks ok.

    Jay

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,105
    Thanks
    23
    Thanked 594 Times in 593 Posts
    You are using JS right?
    What line is throwing error?
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    jason_kelly (04-05-2014)

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Why not do the date conversion on the SQL side?

  • Users who have thanked glenngv for this post:

    jason_kelly (04-05-2014)

  • #6
    Regular Coder
    Join Date
    Sep 2011
    Posts
    184
    Thanks
    140
    Thanked 0 Times in 0 Posts
    How do you go about doing that Glen?

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts

  • Users who have thanked glenngv for this post:

    jason_kelly (04-05-2014)


  •  

    Posting Permissions

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