473,819 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Date & Time Question

3/4/2005 5:50:08 PM

Normally i display the above time and Date above from Database by using
:-

<%= DateTime.Parse( dr["dt"].ToString()).To ShortDateString () %><br/>
<%= DateTime.Parse( dr["dt"].ToString()).To ShortTimeString () %>

Any ideas how to display them together without having to seperate them
as i have done above???
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
2 1147
You can always define a public method to do this for you:

public string PrintDate(DateT ime m_date)
{
return m_date.ToShortD ateString() + m_date.ToShortT imeString();
}

But why not to use ToUniversalTime ()

<%= DateTime.Parse( dr["dt"].ToString()).To UniversalTime() .Tostring() %>
--
Gaidar Magdanurov
VBStreets, Editor-in-Chief
mailto:ga****@v bstreets.ru / http://www.vbstreets.org

"Patrick Olurotimi Ige" <ig*@iprimus.co m.au> wrote in message
news:eX******** ******@TK2MSFTN GP09.phx.gbl...
3/4/2005 5:50:08 PM

Normally i display the above time and Date above from Database by using
:-

<%= DateTime.Parse( dr["dt"].ToString()).To ShortDateString () %><br/>
<%= DateTime.Parse( dr["dt"].ToString()).To ShortTimeString () %>

Any ideas how to display them together without having to seperate them
as i have done above???
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2
Thanks Gaider for the response!..
"gaidar" wrote:
You can always define a public method to do this for you:

public string PrintDate(DateT ime m_date)
{
return m_date.ToShortD ateString() + m_date.ToShortT imeString();
}

But why not to use ToUniversalTime ()

<%= DateTime.Parse( dr["dt"].ToString()).To UniversalTime() .Tostring() %>
--
Gaidar Magdanurov
VBStreets, Editor-in-Chief
mailto:ga****@v bstreets.ru / http://www.vbstreets.org

"Patrick Olurotimi Ige" <ig*@iprimus.co m.au> wrote in message
news:eX******** ******@TK2MSFTN GP09.phx.gbl...
3/4/2005 5:50:08 PM

Normally i display the above time and Date above from Database by using
:-

<%= DateTime.Parse( dr["dt"].ToString()).To ShortDateString () %><br/>
<%= DateTime.Parse( dr["dt"].ToString()).To ShortTimeString () %>

Any ideas how to display them together without having to seperate them
as i have done above???
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 19 '05 #3

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

Similar topics

1
508
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time store in the database. However asp recognizes the data type as date and displays the date instead of the time. If I change the data type in mysql to varchar then asp will display the time correctly, but I cannot do it this way. I want to be able...
1
1967
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for the first page): display the section name, the current file and a few archive files. If there is more than a page full (for each additional page): display the section name, and the next set of archive files.
6
4086
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form the user can change the date, which will force a requery in the subform to bring up records from the date selected. My question is this... The query in the subform is a very simple one, with only three fields being returned. In the interest of...
5
1833
by: nbohana | last post by:
I have a windows form with several fields. One of the fields is a date. I use DateTimePicker to enter and format the date. In my SQL table the date si stored as follows "01/10/2005" and this is what I wont. When I display the date with a 'fill or select' this is what I get '01/10/2005 12:00'. What am I doing wrong? Please Help. -- Norm Bohana
3
5266
by: Magesh | last post by:
How date-time attributes of a file are represented in the structure "struct stat"? Coz as I noted they found to be unsigned integers and I donno how they are interpreted as date & time in the members st_atime, st_mtime, and st_ctime. I don't want any lib fun that returns the corresponding time formatted string coz what I want to know is the interpretation of date-time in those members so that I could extract them and use it for some...
2
2092
by: Colleen Robledo, MLIS | last post by:
Hello, I'm still pretty new to PHP and MySQL, and have a PHP scripting question. If I'm querying DATE info from a MySQL database, and displaying it with PHP echo statements... is there a PHP script I can use to convert the DATE data to standard calendar format? Example:
1
1852
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 your program. Option Explicit Dim Dt, Tm ' Timer set interval=1000 Private Sub Timer1_Timer()
5
5473
by: tushar.saxena | last post by:
This post is a follow up to the post at : http://groups.google.com/group/comp.lang.c++/browse_thread/thread/83af6123fa945e8b?hl=ug#9eaa6fab5622424e as my original question was answered there, but I have some additional problems now. Basically what I want to do is : Given an input UTF-8 encoded file containing HTML sequences such as "&amp;", I want to be able to replace these sequences with their UTF-8 representations (i.e. "&") What I...
3
5200
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
10702
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
10427
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
9247
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
7699
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
5589
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5723
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4380
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
3915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3045
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.