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. General Programming
  3. WPF
  4. Date Problem in SL

Date Problem in SL

Scheduled Pinned Locked Moved WPF
wpfsysadminhelp
7 Posts 3 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
    Jagz W
    wrote on last edited by
    #1

    I am displaying date in my .XAML page In .XAML.VB e.g variablename = date.now() But it is returning my client date. i want to display server date.

    One person's data is another person's program. --J.Walia

    P 1 Reply Last reply
    0
    • J Jagz W

      I am displaying date in my .XAML page In .XAML.VB e.g variablename = date.now() But it is returning my client date. i want to display server date.

      One person's data is another person's program. --J.Walia

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You'd have to call a method on the server side through a WCF call. Be aware, though, that because of latency issues, the value that you receive would be the time that the server received and processed the request, and then by the time the message was transmitted back there would be extra latency involved.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      J 1 Reply Last reply
      0
      • P Pete OHanlon

        You'd have to call a method on the server side through a WCF call. Be aware, though, that because of latency issues, the value that you receive would be the time that the server received and processed the request, and then by the time the message was transmitted back there would be extra latency involved.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        J Offline
        J Offline
        Jagz W
        wrote on last edited by
        #3

        how i can handle this??

        One person's data is another person's program. --J.Walia

        P V 2 Replies Last reply
        0
        • J Jagz W

          how i can handle this??

          One person's data is another person's program. --J.Walia

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          I already told you. Use WCF.

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          • J Jagz W

            how i can handle this??

            One person's data is another person's program. --J.Walia

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #5

            For many applications they in fact use the database datetime for being consistent. in Oracle this could be Select getdate() from dual; I believe.

            V.

            P 1 Reply Last reply
            0
            • V V 0

              For many applications they in fact use the database datetime for being consistent. in Oracle this could be Select getdate() from dual; I believe.

              V.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              V. wrote:

              in Oracle this could be Select getdate() from dual

              No it isn't - Oracle uses select sysdate from dual. Why would you consider doing this though? If you have a web server, then the application has access to the server time anyway, why on earth would you expect it to make an unnecessary call to a database. Bear in mind that the db connection might need to be created which is an expensive operation and database connections should not be squandered on trivial tasks like this; it it's a high traffic site then this is an unnecessary waste of resources. Supplying the date in this format should only be used when attempting to perform an operation on the database, e.g. an insert or update.

              I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

              V 1 Reply Last reply
              0
              • P Pete OHanlon

                V. wrote:

                in Oracle this could be Select getdate() from dual

                No it isn't - Oracle uses select sysdate from dual. Why would you consider doing this though? If you have a web server, then the application has access to the server time anyway, why on earth would you expect it to make an unnecessary call to a database. Bear in mind that the db connection might need to be created which is an expensive operation and database connections should not be squandered on trivial tasks like this; it it's a high traffic site then this is an unnecessary waste of resources. Supplying the date in this format should only be used when attempting to perform an operation on the database, e.g. an insert or update.

                I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Onyx

                V Offline
                V Offline
                V 0
                wrote on last edited by
                #7

                I wasn't 100% sure about the select statement, it might very well have been select sysdate from dual; You can argue about the design, but the concept of taking the database datetime does exist. I never said I was pro or con. If you use more then 1 webserver you also need additional setting up for making sure the time is equal (granted this can be done via time synchro eg).

                V.

                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