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
    202
    Thanks
    152
    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. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    6,333
    Thanks
    30
    Thanked 870 Times in 868 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.
    Physics is actually atoms trying to understand themselves.

  3. Users who have thanked sunfighter for this post:

    jason_kelly (04-05-2014)

  4. #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    202
    Thanks
    152
    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

  5. #4
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    6,333
    Thanks
    30
    Thanked 870 Times in 868 Posts
    You are using JS right?
    What line is throwing error?
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  6. Users who have thanked sunfighter for this post:

    jason_kelly (04-05-2014)

  7. #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Why not do the date conversion on the SQL side?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  8. Users who have thanked glenngv for this post:

    jason_kelly (04-05-2014)

  9. #6
    Regular Coder
    Join Date
    Sep 2011
    Posts
    202
    Thanks
    152
    Thanked 0 Times in 0 Posts
    How do you go about doing that Glen?

  10. #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  11. 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
  •