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

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()).ToShortDateString() %><br/>
<%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>

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 1133
You can always define a public method to do this for you:

public string PrintDate(DateTime m_date)
{
return m_date.ToShortDateString() + m_date.ToShortTimeString();
}

But why not to use ToUniversalTime()

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

"Patrick Olurotimi Ige" <ig*@iprimus.com.au> wrote in message
news:eX**************@TK2MSFTNGP09.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()).ToShortDateString() %><br/>
<%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>

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(DateTime m_date)
{
return m_date.ToShortDateString() + m_date.ToShortTimeString();
}

But why not to use ToUniversalTime()

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

"Patrick Olurotimi Ige" <ig*@iprimus.com.au> wrote in message
news:eX**************@TK2MSFTNGP09.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()).ToShortDateString() %><br/>
<%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>

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
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...
1
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...
6
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...
5
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...
3
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...
2
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...
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...
5
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...
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
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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?
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...

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.