473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Format datetime

hi:
Is there a function to format the datetime value to the following
format 2005-09-29T17:57:03.0000000+08:00 ?

currently i'm using a hard way
Dim result As String
Dim offset As Long

result =
Format(value,DateTimeFormatInfo.CurrentInfo.Sortab leDateTimePattern)

offset = TimeZone.CurrentTimeZone.GetUtcOffset(value).Ticks

result &= CStr(IIf(offset < 0, "-", "+")) & _
Format(New DateTime(offset), "hh:mm")

Thanks
JCVoon
Nov 21 '05 #1
2 2154
Hi,

Take a look at the zzz format

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------------
"JC Voon" <jc*******@yahoo.com> wrote in message
news:43***************@msnews.microsoft.com...
hi:
Is there a function to format the datetime value to the following
format 2005-09-29T17:57:03.0000000+08:00 ?

currently i'm using a hard way
Dim result As String
Dim offset As Long

result =
Format(value,DateTimeFormatInfo.CurrentInfo.Sortab leDateTimePattern)

offset = TimeZone.CurrentTimeZone.GetUtcOffset(value).Ticks

result &= CStr(IIf(offset < 0, "-", "+")) & _
Format(New DateTime(offset), "hh:mm")

Thanks
JCVoon

Nov 21 '05 #2
Ken Tucker:

Thanks.

Now.ToString(DateTimeFormatInfo.CurrentInfo.Sortab leDateTimePattern &
"zzz")

JCVoon

Nov 21 '05 #3

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

Similar topics

6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
5
by: Tom Pair | last post by:
Hi, I use DateTime.Now to display the current date and time. For instance, it's default format is 2003-10-29 21:23:36. How can I change the format as follows? 10/29/2003 9:23:36 PM ...
15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
2
by: Harikumar G | last post by:
Friends, My hardware sends me a date format like this 15:10:20.99 UTC Mon Oct 18 2004 I need to process this format and parse to a valid SQL datetime format, how can I do it more easily? My...
1
by: Ugur Ekinci | last post by:
Hi , I have two Sql Server 2000 on seperate machines , First one accepts datetime format like ("dd.MM.yyyy hh:mm:ss") And Second one accepts datetime format like ("MM.dd.yyyy hh:mm:ss") 1-...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
7
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the...
9
by: Alok yadav | last post by:
i am using a webservice in which a method is serach. i use this method which accept a argument of date type in dd/MM/yyyy formate. i have a textbox which accept the date from the user, when i...
3
by: pamela fluente | last post by:
Hi, I wish to create a string from the current date now() so that it looks like the format used by Excel, for instance: 2006-04-16T19:45:42Z How would I achieve that?
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.