9 Replies - 2734 Views - Last Post: 27 March 2012 - 08:18 AM Rate Topic: -----

#1 default23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 26-March 12

Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 10:58 PM

Hello I am using 2 Datetimepicker for mmddyyyy to yyyymmdd , change automatically , Is this the best Option ,
there are 12 000 + lines to be converted ,
Is This A Good Question/Topic? 0
  • +

Replies To: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

#2 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 11:09 PM

Right… what code are you using? How long does it take?
Was This Post Helpful? 0
  • +
  • -

#3 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 11:13 PM

I don't understand. What lines?

And to set your DateTimePicker to your desired format add these lines,

  
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.CustomFormat = "yyyy/MM/dd"

This post has been edited by nK0de: 26 March 2012 - 11:14 PM

Was This Post Helpful? 0
  • +
  • -

#4 default23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 26-March 12

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 11:34 PM

View PostnK0de, on 26 March 2012 - 11:13 PM, said:

I don't understand. What lines?

And to set your DateTimePicker to your desired format add these lines,

  
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.CustomFormat = "yyyy/MM/dd"



this will change only in Form , but i need to change the format in a text file
Was This Post Helpful? 0
  • +
  • -

#5 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 11:39 PM

You mean the dates that are already saved in a text file?
Was This Post Helpful? 0
  • +
  • -

#6 default23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 26-March 12

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 26 March 2012 - 11:51 PM

View Postdefault23, on 26 March 2012 - 11:34 PM, said:

View PostnK0de, on 26 March 2012 - 11:13 PM, said:

I don't understand. What lines?

And to set your DateTimePicker to your desired format add these lines,

  
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.CustomFormat = "yyyy/MM/dd"



this will change only in Form , but i need to change the format in a text file




Hi
You can see the text file YO.txt

there are some dates in mmddyyyy , that should be converted to yyyymmdd

View PostnK0de, on 26 March 2012 - 11:39 PM, said:

You mean the dates that are already saved in a text file?



Ya , the file contains all the dates , there is a Problem with dates so i am trying to change the date format
and there are about 12 000 lines in the Text file , but i have just added some to the YO. txt file
Was This Post Helpful? 0
  • +
  • -

#7 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 138
  • View blog
  • Posts: 838
  • Joined: 21-December 11

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 27 March 2012 - 02:50 AM

show your code. maybe we can speed up. have you try something like this:
Dim DateFromFile As DateTime = 'date from file.
Dim ConvertedDate As String = DateFromFile.Year & DateFromFile.Month & DateFromFile.Day
If your code is faster (with datetimepickers) I will use your way.
Was This Post Helpful? 0
  • +
  • -

#8 default23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 26-March 12

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 27 March 2012 - 06:28 AM

View Postsela007, on 27 March 2012 - 02:50 AM, said:

show your code. maybe we can speed up. have you try something like this:
Dim DateFromFile As DateTime = 'date from file.
Dim ConvertedDate As String = DateFromFile.Year & DateFromFile.Month & DateFromFile.Day
If your code is faster (with datetimepickers) I will use your way.

Hi
i am looking for the IEDA , Not coded still .

i have a file in which there are Dates , In MMDDYYYY format , i need to change it to YYYYMMDD


as the file is big , i thought of using 2 date time picker to set a range and find and replace

I have not seen your code

regards
Was This Post Helpful? 0
  • +
  • -

#9 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 635
  • Joined: 03-February 10

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 27 March 2012 - 07:37 AM

So what you want is the idea of how to:

1) Open a text file to read it
2) Read it line by line
3) Reformat the string that was read in from MMDDYYYY to YYYYMMDD
4) Compile all the these together
5) And write them all back out to another text

That about sum it up?
Was This Post Helpful? 0
  • +
  • -

#10 default23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 26-March 12

Re: Convert From mmddyyyy to yyyymmdd , in vb.net Problem

Posted 27 March 2012 - 08:18 AM

View Postdemausdauth, on 27 March 2012 - 07:37 AM, said:

So what you want is the idea of how to:

1) Open a text file to read it
2) Read it line by line
3) Reformat the string that was read in from MMDDYYYY to YYYYMMDD
4) Compile all the these together
5) And write them all back out to another text

That about sum it up?

Hi
thanks,

can you please give 1 example
d Short date 10/12/2002 <= convrting

regards
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1