تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
الحصول على الوقت و التاريخ
#2
هذا كود بديل يقرأ من الموقع time.nist.gov
https://www.codeproject.com/Answers/3005...et#answer3
PHP كود :
Public Shared Function GetNistTime() As DateTime
    Dim client 
As New Net.Sockets.TcpClient("time.nist.gov"13)
 
   Dim streamReader As New IO.StreamReader(client.GetStream())
 
   Dim response As String streamReader.ReadToEnd
    Dim utcDateTimeString 
As String response.Substring(717)
 
   Dim localDateTime As DateTime =
 
       DateTime.ParseExact(utcDateTimeString"yy-MM-dd HH:mm:ss",
 
                           Globalization.CultureInfo.InvariantCulture,
 
                           Globalization.DateTimeStyles.AssumeUniversal)
 
   Return localDateTime
End 
Function 
الرد }}}
تم الشكر بواسطة: Rabeea Qbaha , عبد العزيز البسكري , Mohamed20


الردود في هذا الموضوع
RE: الحصول على الوقت و التاريخ - بواسطة طالب برمجة - 07-12-17, 06:48 PM


التنقل السريع :


يقوم بقرائة الموضوع: