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. ASP.NET
  4. best timing!

best timing!

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netmysqlcomquestion
5 Posts 4 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.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I have a post or forum website in ASP.NET and MySQL backend. I want to know what's the best option to save the post's creation time as different people from different countries will access it and it's no proper to show all the EST or GMT time. what's your suggestion?

    Technology News @ www.JassimRahma.com

    S W 3 Replies Last reply
    0
    • J Jassim Rahma

      Hi, I have a post or forum website in ASP.NET and MySQL backend. I want to know what's the best option to save the post's creation time as different people from different countries will access it and it's no proper to show all the EST or GMT time. what's your suggestion?

      Technology News @ www.JassimRahma.com

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      I would save it as a UTC in database. Later convert into Local time in my application based on the people using it.

      Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

      K 1 Reply Last reply
      0
      • J Jassim Rahma

        Hi, I have a post or forum website in ASP.NET and MySQL backend. I want to know what's the best option to save the post's creation time as different people from different countries will access it and it's no proper to show all the EST or GMT time. what's your suggestion?

        Technology News @ www.JassimRahma.com

        W Offline
        W Offline
        wikizhao
        wrote on last edited by
        #3

        var d = new Date(); var localZone = d.getTimezoneOffset()/60;

        1 Reply Last reply
        0
        • S Sandeep Mewara

          I would save it as a UTC in database. Later convert into Local time in my application based on the people using it.

          Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

          K Offline
          K Offline
          kutynko
          wrote on last edited by
          #4

          Just wanted to add that when a user submits a post you should from javascript take current time, convert it to UTC and pass it to the server. And for another user reading this post you receive UTC time from DB, pass it to the client and in javascript convert it to local time. Because client creating a post, web app host, DB server and another client reading the post may all be in different time zones :)

          1 Reply Last reply
          0
          • J Jassim Rahma

            Hi, I have a post or forum website in ASP.NET and MySQL backend. I want to know what's the best option to save the post's creation time as different people from different countries will access it and it's no proper to show all the EST or GMT time. what's your suggestion?

            Technology News @ www.JassimRahma.com

            W Offline
            W Offline
            wikizhao
            wrote on last edited by
            #5

            <script> function ss() { $("#date").text( Date()); } </script> use span and give an id ,name is date. id="date" <input id="Button1" type="button" value="button" onclick="ss()" />

            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