473,397 Members | 1,961 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,397 software developers and data experts.

Date & time separate

I know how to display Date only in the textbox . but How about the time ???
Can I put it into two separate textbox , but save in one datafield ?
thanks a lot.
Nov 21 '05 #1
3 6110
How about:

dAnydate=now
txtDate.text=danyDate.ToShortDateString
txtTime.text=dAnydate.toShortTimeString

dNewDate=date.parse(txtDate.text & " " & txtTime.text)

Be sure to wrap your date.parse line in a try block since you're dealing
with potentially bad user input.

"Agnes" <ag***@dynamictech.com.hk> wrote in
news:#Q**************@TK2MSFTNGP15.phx.gbl:
I know how to display Date only in the textbox . but How about the
time ??? Can I put it into two separate textbox , but save in one
datafield ? thanks a lot.


Nov 21 '05 #2
cbDevelopment,
I would recommend:
txtDate.text=danyDate.ToShortDateString
txtTime.text=dAnydate.toShortTimeString

Dim theDate As DateTime = CDate(txtDate.text) ' or DateTime.Parse
Dim theTime As DateTime = CDate(txtTime.text) ' or DateTime.Parse

dAnydate = theDate + theTime

Simply to guard against globalization problems.

Hope this helps
Jay
"cbDevelopment" <de*********@remove.700cb.net> wrote in message
news:Xn***************************@207.46.248.16.. . How about:

dAnydate=now
txtDate.text=danyDate.ToShortDateString
txtTime.text=dAnydate.toShortTimeString

dNewDate=date.parse(txtDate.text & " " & txtTime.text)

Be sure to wrap your date.parse line in a try block since you're dealing
with potentially bad user input.

"Agnes" <ag***@dynamictech.com.hk> wrote in
news:#Q**************@TK2MSFTNGP15.phx.gbl:
I know how to display Date only in the textbox . but How about the
time ??? Can I put it into two separate textbox , but save in one
datafield ? thanks a lot.

Nov 21 '05 #3
Excellent observation.

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
news:uG**************@TK2MSFTNGP14.phx.gbl:
cbDevelopment,
I would recommend:
txtDate.text=danyDate.ToShortDateString
txtTime.text=dAnydate.toShortTimeString


Dim theDate As DateTime = CDate(txtDate.text) ' or DateTime.Parse
Dim theTime As DateTime = CDate(txtTime.text) ' or DateTime.Parse

dAnydate = theDate + theTime

Simply to guard against globalization problems.

Hope this helps
Jay
"cbDevelopment" <de*********@remove.700cb.net> wrote in message
news:Xn***************************@207.46.248.16.. .
How about:

dAnydate=now
txtDate.text=danyDate.ToShortDateString
txtTime.text=dAnydate.toShortTimeString

dNewDate=date.parse(txtDate.text & " " & txtTime.text)

Be sure to wrap your date.parse line in a try block since you're
dealing with potentially bad user input.

"Agnes" <ag***@dynamictech.com.hk> wrote in
news:#Q**************@TK2MSFTNGP15.phx.gbl:
I know how to display Date only in the textbox . but How about the
time ??? Can I put it into two separate textbox , but save in one
datafield ? thanks a lot.



Nov 21 '05 #4

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

Similar topics

18
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the...
6
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this...
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...
6
by: Blue Bell Trading - Customer Services | last post by:
Hi, I would like to add the current date, and time if possible, to all records in a query? -- Kind Regards, Customer Services Blue Bell Trading
3
by: divya | last post by:
Hi, I have a table tblbwday with 2 fields Name and Birthday.I have written this script for displaying evryday names of the people on that day. <% set objConn...
3
by: colleen1980 | last post by:
Hi: Data in my table is in that format. How to i separate date with time. 11/9/2006 10:10:46 AM Thank You.
2
by: drurjen | last post by:
Good morning. I am importing an XLS file into one of my tables. The fields are: Date Id Time IO 12/22/2006 2 12:48:45 PM 9 12/22/2006 16 5:40:55 AM 1 12/22/2006 16 12:03:59 PM 2 ...
1
by: adeebraza | last post by:
Hi, Every Body Following is code for Showing Actual Date & Time on the form and also record Date & Time of an event. See the following and use Call Modified when you want to record an event in...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
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...
0
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...
0
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,...
0
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...

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.