473,800 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

time formatting error

Hi

I am trying to display a unix timestamp as a time of day. I can do this
but I lose 10 hours. Is this something do with locale or is there an
error in my code?? The timestamp is for 11.20 am, but the message box
displays 1.20am !!

Dim timestamp As Integer = 1159492831

Dim dt As Date = New System.DateTime (1970, 1, 1).AddSeconds(t imestamp)

MessageBox.Show (Format(dt, "hh:mm tt"))
any help appreciated
Dave

Sep 29 '06 #1
2 1004
Hi,

I am not an expert but I know sometime it could happen if your server is
hosted remotely.

Is it your case? If so, you may need adding extra 10 hours to values.
Don't ask me how, I am an idiot in programming :)

Hope this helps.

<li********@yah oo.com.auwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Hi

I am trying to display a unix timestamp as a time of day. I can do this
but I lose 10 hours. Is this something do with locale or is there an
error in my code?? The timestamp is for 11.20 am, but the message box
displays 1.20am !!

Dim timestamp As Integer = 1159492831

Dim dt As Date = New System.DateTime (1970, 1, 1).AddSeconds(t imestamp)

MessageBox.Show (Format(dt, "hh:mm tt"))
any help appreciated
Dave

Sep 30 '06 #2
There is no remote server involved, the timestamp is generated on the
local machine.

cheers Dave
xfile wrote:
Hi,

I am not an expert but I know sometime it could happen if your server is
hosted remotely.

Is it your case? If so, you may need adding extra 10 hours to values.
Don't ask me how, I am an idiot in programming :)

Hope this helps.

<li********@yah oo.com.auwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Hi

I am trying to display a unix timestamp as a time of day. I can do this
but I lose 10 hours. Is this something do with locale or is there an
error in my code?? The timestamp is for 11.20 am, but the message box
displays 1.20am !!

Dim timestamp As Integer = 1159492831

Dim dt As Date = New System.DateTime (1970, 1, 1).AddSeconds(t imestamp)

MessageBox.Show (Format(dt, "hh:mm tt"))
any help appreciated
Dave
Oct 3 '06 #3

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

Similar topics

8
9449
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $ Last-Modified: $Date: 2003/10/28 19:48:44 $ Author: A.M. Kuchling <amk@amk.ca> Status: Draft Type: Standards Track
3
1595
by: joe ruggeri | last post by:
Hey All ... I'm developing in ASP/VBScript using DreamweaberMX, w/ an Access 2000 DB as the data source. The source of the data is coming from a third party, which I get as a CSV and import into the database, updating it weekly. Since I have no control over how the data is collected, I'm not sure how to fix this problem, but here it is. This is a database of movies and among the many fields I import is one for the
4
4163
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I want all of the controls in whatever is the CURRENT record to have it's data bolded on the screen. (Question #1: Is there a SIMPLE way to refer to the Current Record?) I've been trying to use a Bookmark to specify the current record, but it
4
3144
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses the focus. Any way around this? Is it a bug? Or have they "improved" it?
0
3320
by: Miranda Evans | last post by:
I noticed several postings about issues related to "run-time error 3061", and I observed that the solutions to these issues appear to involve correcting something within the SQL code. I'm encountering the "run-time error 3061" issue, but I'm not sure how to go about correcting the SQL. My hunch is that I have not properly constructed things to identify a date field, but I don't know how to correct this issue. In addition to not...
2
19136
by: DWalker | last post by:
In Visual Studio (Visual Basic) .NET 2002, I noticed that this: Dim Elapsed as DateTime = Now - Now gives a "compile time" error (error in the IDE), saying that the '-' operator is not defined for the Date datatype. On the other hand, Dim Elapsed as DateTime = Now + Now does not give a compile time error but it thinks you're trying to
26
4603
by: geolev | last post by:
I'm trying to understand the effects of the Daylight Saving Time rule changes for 2007 in the US. Can anyone tell me how Javascript knows when to apply Daylight Saving Time in the following script? d1 = new Date(2006, 03, 01, 23, 00); d2 = new Date(2006, 03, 02, 04, 00); // Reports "This is ok: The answere should be 4. It is 4". alert("This is ok: The answer should be 4. It is " + (((d2.valueOf() - d1.valueOf())/1000)/60)/60);
3
3318
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when the field should only be showing one or the other (date or time). Even on the back end of the database where the column properties are, I have chosen the smallest date/time formats. When the aspx page runs, it shows the date and time (ie:in a...
130
3363
by: Gianni Mariani | last post by:
Attached example CPP files makes it easier to post code and extract code from posts. It's unimaginable at this time where virtually any news reader is capable of dealing with attachments to stick with such old antiquated rules. It's time for a change. I reccomend that the faq-5.4 bullet be changed: http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.4 from:
7
1680
by: christery | last post by:
Anyone got a clue to why ther is a T between date and time in the "formatted for sorting" or whatewer they call it, and a Z at the end after seconds- got it fixed for my cobol programmer by formatting it with yyyy ... aso, made the mistake with mm and MM but got it befre someone saw) but really think its strange, excel dosent like that format either. M$ not m$ compatible? Not a problem for me at the moment, just itrested if im missing...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10501
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
10273
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...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
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...
1
7574
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
6811
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
4149
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.