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. Visual Basic
  4. DateTime Format on remote machine

DateTime Format on remote machine

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
6 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.
  • V Offline
    V Offline
    vilmer
    wrote on last edited by
    #1

    Hi everyone, I am trying to develop an app which should read date info from a remote machine (which has MS win on board). My problem is: I don't know the CurrentCulture of the remote machine and therefore I don't know which is the DateTime format of the dates I retrieve. If I get some special dates, for example 02/01/06, I wouldn't know which one represents the day, month or year. Is there any way to retrieve the culture or just the datetime format of the remote machine? N.B. just keep in mind that I only know the IP address of the remote machine and I'm not allowed to deploy any component on it

    M D 2 Replies Last reply
    0
    • V vilmer

      Hi everyone, I am trying to develop an app which should read date info from a remote machine (which has MS win on board). My problem is: I don't know the CurrentCulture of the remote machine and therefore I don't know which is the DateTime format of the dates I retrieve. If I get some special dates, for example 02/01/06, I wouldn't know which one represents the day, month or year. Is there any way to retrieve the culture or just the datetime format of the remote machine? N.B. just keep in mind that I only know the IP address of the remote machine and I'm not allowed to deploy any component on it

      M Offline
      M Offline
      militiaware
      wrote on last edited by
      #2

      When you get the date in any format (which you don't know) convert it to the format you want. for example you've got 01/03/06 => convert it to yyyy/M/d it will innerly will convert to 2006/Mar/01 (if you considered that the fomat of 01/03/06 is d/m/y) Faris Madi Nothing Comes Easy (N.C.E.)

      V 1 Reply Last reply
      0
      • M militiaware

        When you get the date in any format (which you don't know) convert it to the format you want. for example you've got 01/03/06 => convert it to yyyy/M/d it will innerly will convert to 2006/Mar/01 (if you considered that the fomat of 01/03/06 is d/m/y) Faris Madi Nothing Comes Easy (N.C.E.)

        V Offline
        V Offline
        vilmer
        wrote on last edited by
        #3

        Sorry, maybe I didn't tell you that the date comes as a string. I can't wonder about its format. If the machine had english date format, 01/03/06 means 2006/Jan/03.

        1 Reply Last reply
        0
        • V vilmer

          Hi everyone, I am trying to develop an app which should read date info from a remote machine (which has MS win on board). My problem is: I don't know the CurrentCulture of the remote machine and therefore I don't know which is the DateTime format of the dates I retrieve. If I get some special dates, for example 02/01/06, I wouldn't know which one represents the day, month or year. Is there any way to retrieve the culture or just the datetime format of the remote machine? N.B. just keep in mind that I only know the IP address of the remote machine and I'm not allowed to deploy any component on it

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          vilmer wrote:

          am trying to develop an app which should read date info from a remote machine

          How are you doing this?? Are you using a compponent on the remote machine that you wrote? Dave Kreskowiak Microsoft MVP - Visual Basic

          V 1 Reply Last reply
          0
          • D Dave Kreskowiak

            vilmer wrote:

            am trying to develop an app which should read date info from a remote machine

            How are you doing this?? Are you using a compponent on the remote machine that you wrote? Dave Kreskowiak Microsoft MVP - Visual Basic

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

            The remote machine hosts a scada system and I can manage some APIs to exchange data with it. The remote machine comes as is, so I can't install any other component on it. I just have this library to communicate with it and the function defined in my library returns me a string

            D 1 Reply Last reply
            0
            • V vilmer

              The remote machine hosts a scada system and I can manage some APIs to exchange data with it. The remote machine comes as is, so I can't install any other component on it. I just have this library to communicate with it and the function defined in my library returns me a string

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              In that case, you're on your own. You'll have to consult with the docs on the API to find out if the datetime your getting is in any specifal format, not culture specific, or it it'll give you the culture info. I'm doubting it though. Dave Kreskowiak Microsoft MVP - Visual Basic

              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