Welcome to Dream.In.Code
Become a VB Expert!

Join 149,915 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,141 people online right now. Registration is fast and FREE... Join Now!




date format

 
Reply to this topicStart new topic

date format

muddasir
8 Jan, 2008 - 10:31 AM
Post #1

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
i am using vb6 and sqlserver 2000.
one problem i am facing is in my project
i want to use date format dd/mm/yyyy
now i know the function which when ever
if the date is not in the above format changes
the default system date format to dd/mm/yy
at the start module of programe

the problem is actually if the date format
is not dd/mm/yy the while viewing report
it give me the error
"invalid date time"

but when i restart my programe its work fine.

can any body guess what is the problem

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Date Format
8 Jan, 2008 - 11:38 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
You need to show us the code that is causing you the problems, please use code tags when posting your code ( code.gif ) that makes things much neater and easier for us to read. But without seeing the code its hard to troubleshoot something we cannot see smile.gif
User is offlineProfile CardPM
+Quote Post

Trazz
RE: Date Format
9 Jan, 2008 - 01:08 AM
Post #3

New D.I.C Head
*

Joined: 21 Dec, 2006
Posts: 12


My Contributions
Hi,

I just have this like
CODE
dateStr = Format(Date, "ddmmmyyyy")


Prehaps you can make yours to (copied from Help):
Format syntax Result
Format(Now, "m/d/yy") 1/27/93



User is offlineProfile CardPM
+Quote Post

muddasir
RE: Date Format
9 Jan, 2008 - 07:48 AM
Post #4

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
actually coding does not create problem for me
coding changes system date format when the
programe start (if the system date format is mm/dd/yy
and i start my progrmame them when i look into control
panel system dates changes in dd/mm/yy)

but date format does not take effect in sql server until
i restart my progrmae.

for e-g
my system date format (set from control panel) is
mm.dd.yy when i start my programe then if i look
into control panel for date foramat its changes into
dd.mm.yy but still my programe give error

"unrecognized date format"

but if i close my programe and restart its its work fine
why?



coding of change system date format is the same
which i made a Snippet
"change system date format"
you can see it on a snippet









QUOTE(PsychoCoder @ 8 Jan, 2008 - 12:38 PM) *

You need to show us the code that is causing you the problems, please use code tags when posting your code ( code.gif ) that makes things much neater and easier for us to read. But without seeing the code its hard to troubleshoot something we cannot see smile.gif


User is offlineProfile CardPM
+Quote Post

muddasir
RE: Date Format
10 Jan, 2008 - 07:33 AM
Post #5

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
i got the reason
the reason is i am fomating my date as dd/mm/yy

insted of i had to format it like that dd/MMM/yy
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 02:18PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month