Author Topic: date conflict US Europe  (Read 4290 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
date conflict US Europe
« on: July 02, 2005, 06:23:29 AM »
Hello all together.

I have a problem with the different date version in the States and in Europe.
So is there a way I can get the today’s date in a d-m-yyyy  format as return from an English Office version?

Thanks in advance,


Bernd :(

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
date conflict US Europe
« Reply #1 on: July 02, 2005, 03:32:09 PM »
How about this?
Code: [Select]

Function EuroDate() As String
Dim MyDate
Dim dateVar

MyDate = Date
dateVar = Split(MyDate, "/")
MyDate = dateVar(1) & "/" & dateVar(0) & "/" & dateVar(2)

EuroDate = MyDate
End Function

Sub test()

Debug.Print EuroDate

End Sub

Amsterdammed

  • Guest
date conflict US Europe
« Reply #2 on: July 02, 2005, 04:55:34 PM »
Jeff,

I just found something easy

Code: [Select]



Sub test()
Dim EDate As String
EDate = Date
EDate = Format(EDate, ("DD-MM-YYYY"))
MsgBox EDate
End Sub


I need the date also as part of a filename, so i need the - in it, no \

I just learned about the split finction, new to me.Really handy. You know VBA is pretty unknown to me.

Thanks
 Bernd

Amsterdammed

  • Guest
date conflict US Europe
« Reply #3 on: July 02, 2005, 04:59:40 PM »
But that works only if edate is declared as string not as date

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
date conflict US Europe
« Reply #4 on: July 02, 2005, 05:04:43 PM »
Sub test()
MsgBox Format(Date, ("DD-MM-YYYY"))
End Sub

This works, too.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
date conflict US Europe
« Reply #5 on: July 02, 2005, 05:40:13 PM »
:D

or

MsgBox Format(Date, ("YYYY-MM-DD"))
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Amsterdammed

  • Guest
date conflict US Europe
« Reply #6 on: July 03, 2005, 02:16:08 AM »
Yep, but i needed the string for a filename, the MsgBox was just for the test.