473,387 Members | 1,925 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.

Date Time Function

Hi! I have a requirement, where in I am saving the events based on certain
date seleceted from the drop down values. Onces saved the data is stored in
database. I have calendar control which highlights the date having events and
onclick on the dates it shows the event details. Its working fine on my
system, but when I sending the same to my client (in UK, who use dd/mm/yyyy
format), it showing worng result. eg. If I have a event on 10th April
(04/10/2006), it showing it as a record for 4th of October(10/04/2006).

How to solve the same.. I am using SQL 200 to store the datas and vb.NET for
code behind coding. I am using VB.NET DateTime function to convert the
Dataset column values to date time

Dim dtStartDate As DateTime
dtStartDate = New DateTime
dtStartDate =
Format(Convert.ToDateTime(tblMonthEvents.Rows(intD ayCount).Item("StartDate")), "MM/dd/yyyy")

Apr 10 '06 #1
3 3633
You need to check the current culture and use this in your code

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Baren" <Ba***@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
Hi! I have a requirement, where in I am saving the events based on certain
date seleceted from the drop down values. Onces saved the data is stored
in
database. I have calendar control which highlights the date having events
and
onclick on the dates it shows the event details. Its working fine on my
system, but when I sending the same to my client (in UK, who use
dd/mm/yyyy
format), it showing worng result. eg. If I have a event on 10th April
(04/10/2006), it showing it as a record for 4th of October(10/04/2006).

How to solve the same.. I am using SQL 200 to store the datas and vb.NET
for
code behind coding. I am using VB.NET DateTime function to convert the
Dataset column values to date time

Dim dtStartDate As DateTime
dtStartDate = New DateTime
dtStartDate =
Format(Convert.ToDateTime(tblMonthEvents.Rows(intD ayCount).Item("StartDate")),
"MM/dd/yyyy")

Apr 10 '06 #2
Thanks a Lot..

Regards,
Baren

"OHM ( One Handed Man )" wrote:
You need to check the current culture and use this in your code

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Baren" <Ba***@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
Hi! I have a requirement, where in I am saving the events based on certain
date seleceted from the drop down values. Onces saved the data is stored
in
database. I have calendar control which highlights the date having events
and
onclick on the dates it shows the event details. Its working fine on my
system, but when I sending the same to my client (in UK, who use
dd/mm/yyyy
format), it showing worng result. eg. If I have a event on 10th April
(04/10/2006), it showing it as a record for 4th of October(10/04/2006).

How to solve the same.. I am using SQL 200 to store the datas and vb.NET
for
code behind coding. I am using VB.NET DateTime function to convert the
Dataset column values to date time

Dim dtStartDate As DateTime
dtStartDate = New DateTime
dtStartDate =
Format(Convert.ToDateTime(tblMonthEvents.Rows(intD ayCount).Item("StartDate")),
"MM/dd/yyyy")


Apr 10 '06 #3
> Hi! I have a requirement, where in I am saving the events based on certain
date seleceted from the drop down values. Onces saved the data is stored in
database. I have calendar control which highlights the date having events and
onclick on the dates it shows the event details. Its working fine on my
system, but when I sending the same to my client (in UK, who use dd/mm/yyyy
format), it showing worng result. eg. If I have a event on 10th April
(04/10/2006), it showing it as a record for 4th of October(10/04/2006).

How to solve the same.. I am using SQL 200 to store the datas and vb.NET for
code behind coding. I am using VB.NET DateTime function to convert the
Dataset column values to date time

Dim dtStartDate As DateTime
dtStartDate = New DateTime
dtStartDate =
Format(Convert.ToDateTime(tblMonthEvents.Rows(intD ayCount).Item("StartDate")),
"MM/dd/yyyy")


If that "StartDate" column really is a DateTime value (and not a
varchar
that looks like a date), you can use a straight cast to convert it
to a DateTime.

In C# I would use
dtStartDate = (DateTime)tblMonthEvents.Rows[intDayCount]["StartDate"];

Hans Kesting
Apr 10 '06 #4

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

Similar topics

8
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 $...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
8
by: Dennis M. Marks | last post by:
What is the maximum valid date range for the date(yyyy,mm,dd) function. -- Dennis M. Marks http://www.dcs-chico.com/~denmarks/ Replace domain.invalid with dcsi.net -----= Posted via...
8
by: dlx_son | last post by:
Here is the code so far <form name="thisform"> <h3>Enter time to add to or subtract from:</h3> (If not entered, current time will be used)<br> Day: <input name="d1" alt="Day of month"...
2
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
3
by: yxq | last post by:
Hello, The XP Desktop clean wizard can get the last access time of desktop shortcut, i found that the info come from ...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
11
by: Connie via AccessMonster.com | last post by:
Hi Access Building Friends, I am building a database for a manufacturer who needs to know the projected End_Date of each job. I know the Start_Date and the total days required to do the job. ...
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
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,...
0
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...

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.