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

How to split datetime format?

16
Hi,

I have stored "DateTime" format in the database, but i need only "date" at the time of retrive. How to do this? Please help.

Thanks in advance.

Satees
Dec 29 '06 #1
4 1724
Hi,

I have stored "DateTime" format in the database, but i need only "date" at the time of retrive. How to do this? Please help.

Thanks in advance.

Satees
hi...
even if u retrieve d stored data in datetime frmt, u can get date frm it right?
will that b a solution for ur pblm? then u can have d following code...

while (++i < datestring.Length) //datestring -> datetime value retrieved...
{
if (datestring[i] == ' ')
break;
date += datestring[i];
}

hope this helps...
thanx...
sand...
Dec 29 '06 #2
kenobewan
4,871 Expert 4TB
I would format the output datetime to date, something like...
Expand|Select|Wrap|Line Numbers
  1. format(date, "dd/mm/yy")
Hope that this helps.
Dec 29 '06 #3
Hi..
When you are fetching the date you can use substring function.

Hope this hepls..


Hi,

I have stored "DateTime" format in the database, but i need only "date" at the time of retrive. How to do this? Please help.

Thanks in advance.

Satees
Dec 30 '06 #4
hariharanmca
1,977 1GB
Hi..
When you are fetching the date you can use substring function.

Hope this hepls..

Which DataFormat you give for Date (String or DateTime)

if it is String then you have to split it using mid function or if it is DateTime then you can use Format(date,"<Date Format>")
<Date Format> ma be in "dd/MM/yyyy" or "dd-MMM-yyyy"....
Jan 2 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

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" ...
38
by: nobody | last post by:
I know that given a FormatString and a DateTime you can use DateTime.ToString(...) to convert the DateTime to a String. My question is how can you turn that around? Given a String and a...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
4
by: Arpan | last post by:
A SQL Server 2005 DB table has 4 columns namely "ID" (IDENTITY int column), "FirstName" (varchar(50)), "LastName" (varchar(50)) & "DOB" (datetime). Now when I am trying to add a new row using the...
5
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.