is posible convert mm/dd/yyyy to dd/mm/yyyy in visual basic 6.0?

need to convert a north american date format (mm/dd/yyyy) to a chilean date format (dd/mm/yyyy)

is this posible?

thanks a lot!

matt.
matthews_30Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Mikal613Connect With a Mentor Commented:
Printing Formatted Dates and Times
To print formatted dates and times, use the Format function with symbols representing date and time. These examples use the Now and Format functions to identify and format the current date and time. The following examples assume that the Regional Settings dialog box of the Windows Control Panel is set to "English(United States)".

Format syntax Result
Format(Now, "m/d/yy") 1/27/93
Format(Now, "dddd, mmmm dd, yyyy") Wednesday, January 27, 1993
Format(Now, "d-mmm") 27-Jan
Format(Now, "mmmm-yy") January-93
Format(Now, "hh:mm AM/PM") 07:18 AM
Format(Now, "h:mm:ss a/p") 7:18:00 a
Format(Now, "d-mmmm h:mm") 3-January 7:18


By using the Now function with the format "ddddd" and "ttttt, " you can print the current date and time in a format appropriate for the selection in the Regional Settings dialog box of the Windows Control Panel.

Country Format syntax Result
Sweden Format(Now, "ddddd ttttt") 1992-12-31 18.22.38
United Kingdom Format(Now, "ddddd ttttt") 31/12/92 18:22:38  
Canada (French) Format(Now, "ddddd ttttt") 92-12-31 18:22:38
United States Format(Now, "ddddd ttttt") 12/31/92 6:22:38 PM
0
 
jimbobmcgeeCommented:
Try

    a = "11/26/2004"    'DATE IN US FORMAT - 26-NOV-2004
    d = Format(a, "dd/mm/yyyy")     'YOUR DATE FORMAT

or

    a = "11/26/2004"     'DATE IN US FORMAT - 26-NOV-2004
    d = CDate(a)      'DATE IN FORMAT OF SYSTEM

HTH

J.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
jagadeesh_motamarriCommented:



c Displays the date and time.
d Displays the day as a number without a leading zero.
dd Displays the day as a number with a leading zero.
ddd Displays the day as an abbreviation (eg. Mon).
dddd Displays the day as text (eg. Monday).
ddddd Displays the complete date in short format.
dddddd Displays the complete date in long format.
w Displays the day of the week as a number (eg. Sunday = 1).
ww Displays the week of the year as a number.
m Displays the month as a number without a leading zero.
mm Displays the month as a number with a leading zero.
mmm Displays the month as an abbreviation (eg. Jan).
mmmm Displays the month as text (eg. January).
q Displays the quarter of the year (1 - 4).
y Displays the day of the year (1 - 366).
yy Displays the year with two digits.
yyyy Displays the year with four digits.
h Displays the hour without a leading zero.
Hh Displays the hour with a leading zero.
N Displays the minute without a leading zero.
Nn Displays the minute with a leading zero.
S Displays the seconds without a leading zero.
Ss Displays the seconds with a leading zero.
ttttt Displays the complete time according to the locale.
AM/PM
am/pm Displays either a lowercase or uppercase AM or PM adornment for 12-hour formatted time, according to which expression is used.
eg. Format(Now, "Hh:Nn:Ss AM/PM").




some more formats...

Format(Now, “m/d/yy”) 1/27/99
Format(Now, “dddd, mmmm dd, yyyy”) Wednesday, January 27, 1999
Format(Now, “d-mmm”) 27-Jan
Format(Now, “mmmm-yy”) January-99
Format(Now, “hh:mm AM/PM”) 07:18 AM
Format(Now, “h:mm:ss a/p”) 7:18:00 a
Format(Now, “d-mmmm h:mm”) 3-January 7:18




u can use any combination of ur choice...


0
 
Shiju SasidharanAssoc Project ManagerCommented:
hi
  jimbobmcgee, u get the point
u were fast
;-)
0
 
jimbobmcgeeCommented:
Thanks, shijusn.  A couple of things to note when using format():

    1.  It will take the date in whichever format it is recognised by the system and display it as per your specification.  Be
         careful, still, when dealing with dates such as 02/10/2004 or 11/10/1995, etc -- it depends on your system settings
         as to what part of the date is recognised as what.

    2.  The results of the available formatting are limited depending on the variable type to which you are storing it.  If you
         are storing the formatted result in a Date variable, you may find it only viewable as dd/mm/yyyy or mm/dd/yyyy.  To
         use formats such as mmm or mmmm, you will have to store as a String but this can limit your date calculations, if
         you do any.

HTH

J.
0
 
Shiju SasidharanAssoc Project ManagerCommented:
hi jimbobmcgee
u r right
thanks
;-)
Shiju
0
All Courses

From novice to tech pro — start learning today.