Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default write date into file in YYYY.MM.DD format

From VBA I want to write a date into a file a file in the format
YYYY.MM.DD
how can I do this?


Lars
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default write date into file in YYYY.MM.DD format

Hi Lars

Why not use the ISO format
http://www.rondebruin.nl/isodate.htm

1. Dates must be represented in either:
a. non-separated form of yyyymmdd (eg 20050330 for 30-Mar-2005)
b. separated form of yyyy-mm-dd (eg 2005-03-30 for 30-Mar-2005)



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Lars Schouw" wrote in message ...
From VBA I want to write a date into a file a file in the format
YYYY.MM.DD
how can I do this?


Lars

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default write date into file in YYYY.MM.DD format

Thanks Ron,

=TEXT(TODAY(),"yyyy.mm.dd")

seems to do the stunt..

I need this format since some application have depends on it.. I agree
ISO format is much nicer,
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default write date into file in YYYY.MM.DD format

Look out if you also use Non English systems if you use the Text function

yyyy in the Netherlands is jjjj

English language Version entry:
="Today is "&TEXT(TODAY(),"yyyy-mm-dd")

In English language version the formula returns:
Today is 2005-02-23

Fails when the when workbook is open in Dutch language version (year = jaar "jjjj-mm-dd").
With a Dutch language version the formula will return:
Today is yyyy-02-23





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Lars Schouw" wrote in message ...
Thanks Ron,

=TEXT(TODAY(),"yyyy.mm.dd")

seems to do the stunt..

I need this format since some application have depends on it.. I agree
ISO format is much nicer,

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default write date into file in YYYY.MM.DD format

Thanks I sometimes have users on Japanese systems.
Is there a nice workaround for that problem ?
Lars
On May 28, 10:03*pm, "Ron de Bruin" wrote:
Look out if you also use Non English systems if you use the Text function

yyyy in the Netherlands is *jjjj

English language Version entry:
="Today is "&TEXT(TODAY(),"yyyy-mm-dd")

In English language version the formula returns:
Today is 2005-02-23

Fails when the when workbook is open in Dutch language version (year = jaar "jjjj-mm-dd").
With a Dutch language version the formula will return:
Today is yyyy-02-23

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"Lars Schouw" wrote in ...
Thanks Ron,


=TEXT(TODAY(),"yyyy.mm.dd")


seems to do the stunt..


I need this format since some application have depends on it.. I agree
ISO format is much nicer,- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default write date into file in YYYY.MM.DD format

Hi Lars

If you do it with VBA it is always working correct

Sub test()
ActiveCell.Value = Format(Date, "yyyy.mm.dd")
End Sub

But not with the worksheetfunction



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Lars Schouw" wrote in message ...
Thanks I sometimes have users on Japanese systems.
Is there a nice workaround for that problem ?
Lars
On May 28, 10:03 pm, "Ron de Bruin" wrote:
Look out if you also use Non English systems if you use the Text function

yyyy in the Netherlands is jjjj

English language Version entry:
="Today is "&TEXT(TODAY(),"yyyy-mm-dd")

In English language version the formula returns:
Today is 2005-02-23

Fails when the when workbook is open in Dutch language version (year = jaar "jjjj-mm-dd").
With a Dutch language version the formula will return:
Today is yyyy-02-23

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"Lars Schouw" wrote in ...
Thanks Ron,


=TEXT(TODAY(),"yyyy.mm.dd")


seems to do the stunt..


I need this format since some application have depends on it.. I agree
ISO format is much nicer,- Hide quoted text -


- Show quoted text -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change date format from dd/mm/yyyy to mm/yyyy flow23 Excel Discussion (Misc queries) 3 April 4th 23 11:26 AM
How do I save date format: dd mmm yyyy as a csv file? MarcoT Excel Discussion (Misc queries) 2 May 5th 09 02:35 PM
Date format changes from 'yyyy-mm-dd hh:mm:ss' to 'mm/dd/yyyy' ssingh Excel Programming 1 May 4th 07 02:58 PM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
opening excel file - date format problem: DD/MM/YYYY vs MM/DD/YYYY yung Excel Programming 2 March 18th 05 12:50 PM


All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"