473,605 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GMT Time Difference

Hi,
Is there any way to get the time difference between Central(US) and GMT in
vb.net.
I'll appreciate your help/suggestion.

Thanks
RC
Nov 21 '05 #1
3 14880
I would assume that all you needed to do was add back the time that Central
time was behind GMT.

Central time is GMT-6 hours.

Just take your current time and add back 6 hours to get to GMT.

"Richard" <Ri*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
Is there any way to get the time difference between Central(US) and GMT in
vb.net.
I'll appreciate your help/suggestion.

Thanks
RC

Nov 21 '05 #2
That will work but be sure to check for daylight savings time and adjust
accordingly (GMT - 7)

"Ray Cassick" wrote:
I would assume that all you needed to do was add back the time that Central
time was behind GMT.

Central time is GMT-6 hours.

Just take your current time and add back 6 hours to get to GMT.

"Richard" <Ri*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
Is there any way to get the time difference between Central(US) and GMT in
vb.net.
I'll appreciate your help/suggestion.

Thanks
RC


Nov 21 '05 #3
Richard,
DateTime.Now will return the "current" time based on your time zone.

DateTime.ToUniv ersalTime will return GMT time.

You can subtract the two values to get the difference...

Dim now As DateTime = DateTime.Now
Dim nowGMT As DateTime = now.ToUniversal Time()
Dim diff As TimeSpan = now.Subtract(no wGMT)
Debug.WriteLine (diff, "diff")

Alternatively you could use the various properties of System.TimeZone :

Dim time As DateTime = DateTime.Now

Dim tz As TimeZone = TimeZone.Curren tTimeZone

With tz
Debug.WriteLine (.DaylightName, "daylight name")
Debug.WriteLine (.StandardName, "standard name")
Debug.WriteLine (.GetDaylightCh anges(time.Year ), "daylight
changes")
Debug.WriteLine (.GetUtcOffset( time), "utc offset")
Debug.WriteLine (.IsDaylightSav ingTime(time), "daylight saving
time")
End With

Hope this helps
Jay

"Richard" <Ri*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
Is there any way to get the time difference between Central(US) and GMT in
vb.net.
I'll appreciate your help/suggestion.

Thanks
RC

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4042
by: John | last post by:
Hi I am trying to find difference between two time values in hours. I have tried the following? ? dateDiff("h", #23:00:00#, #23:00:00#) gives 0 as expected. ? dateDiff("h", #00:00:00#, #23:00:00#) gives 23??? should it not be 1 as 00:00:00 (12 midnight) is only one hour after 23:00:00 (11 pm)?
1
17006
by: Sunny | last post by:
I am interested in finding out the time it takes to complete a certain section of my source code How do i determine the time difference between the beginning of a process and its end. I need to get the result in Minutes and then second, like e.g. 3 minutes 45 seconds Any suggestions for a fast solution to this Thanks in Advance
1
1355
by: Usman Ghani | last post by:
Hi There, I want to display below page creation time and so I have two variables as: Dim start_time As New DateTime Dim end_time As New DateTime First I am storing value in start_time on page pre_render as Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender start_time = Now End Sub
2
3177
by: cmrhema | last post by:
Hello I have a table GPSDATA which consists of VehicleNo,Speed,CurrentDate,slno,status This data gets updated every minute.And every minute the slno(serial no) will be incremented automatically. The status field shows whether the vehicle is moving or idle(That is neither in stop nor in moving) position The user will choose the vehicleno(From the Front End which is VB.net 2005) and I want to display the time difference between the...
2
8898
by: idealfellow | last post by:
I am using the following to get the time: puts Time.now --> starting of my script <MY CODE> puts Time.now --> end of my script I want to get the Time difference between two Time.now Problem I am facing is i cannot directly take the difference as Time.now displays the time in following format : "Tue Feb 12 19:55:37 +0530 2008"
2
1794
by: hridya | last post by:
can any one help me i want to ge the time difference betwwen two times eg: time1=12:10:10 time 2:=12:20:10 i want time2-time1
3
3429
by: Steve | last post by:
I am trying to calculate elapsed travel times for flights. My plan is to enter the local departure time, the departure city and the local arrival time and city. These times would be standardised to GMT and a date difference calculated which would be the theoretical elapsed time of the flight I have one Table called Cities which has the name of the city and the difference from GMT eg Sydney is 10 (ie 10 hrs ahead of GMT), LA is -7 ie 7...
3
3933
by: RN1 | last post by:
A Form has 2 TextBoxes where in users enter date & time. Example (in mm/dd/yyyy format): 09/20/2008 17:54 (1st TextBox) 09/29/2008 6:13 (2nd TextBox) How do I find out how much time (in hours & minutes) has elapsed between the 2 datetime values? I need the exact time difference.
2
3334
by: Guruganesh | last post by:
i have to calculate the time diference of two file names namely File 1: CBE03KMD_2010_03_08_23_06_36.upl File 2: CBE03KMD_2010_03_08_22_11_47.upl see the date is same but the time is also mentioned in the file name. i need a function to calculate the time difference between the two file names.
0
7937
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8290
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6749
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2438
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1274
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.