Is there a way to change the Date/time stamp format from inside a Label?

Is there a way to change the Date/time stamp format from inside a Label?

revitworkbench
Collaborator Collaborator
5,656 Views
5 Replies
Message 1 of 6

Is there a way to change the Date/time stamp format from inside a Label?

revitworkbench
Collaborator
Collaborator

Hello, Is there a way to change the Date/time stamp format inside revit? It gives : 1/25/2017 12:44:38 PM but I want January 25, 2017... can I do that? How?

0 Likes
Accepted solutions (1)
5,657 Views
5 Replies
Replies (5)
Message 2 of 6

RobDraw
Mentor
Mentor

If there is, I can't find it either.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 3 of 6

robert.klempau
Advisor
Advisor

Hello @revitworkbench,

 

I was thinking of a Dynamo script.

 

date time dynamo.png

 

But not yet in the right format. Smiley Sad

 

I hope I will get it. (asking help on the Dynamo forum)

 

 

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,
Robert Klempau
Senior Consultant AEC
Cadac Group AEC BV

0 Likes
Message 4 of 6

robert.klempau
Advisor
Advisor

Hello @revitworkbench and @RobDraw,

 

Good news:

See this twitter message:

 

adding a core node that reports DateTime in a specified format

 

When they added that to the core, you are able to do the job. Smiley Happy

 

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,
Robert Klempau
Senior Consultant AEC
Cadac Group AEC BV

Message 5 of 6

robert.klempau
Advisor
Advisor
Accepted solution

Hello @revitworkbench and @RobDraw,

 

I have the solution Smiley Very Happy

 

See the Dynamo script below and in the attachment.

just place it in the Daynamo player when you have Revit 2017.1

 

date and Time Dynamo.png

 

Below you see the Python Script:

 

Date and time Phyton.png

 

 

********************************************************************************

import sys
sys.path.append(r"C:\Program Files (x86)\IronPython 2.7\Lib")

from datetime import datetime
now = datetime.now()
str_format = IN[0]

OUT = now.strftime(str_format)
# >>>  25-01-2017

 

********************************************************************************

 

See this link for the date and time format string parameters.

Just play with it.

 

Please let me know if this is your solution.

 

 

 

 

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,
Robert Klempau
Senior Consultant AEC
Cadac Group AEC BV

Message 6 of 6

F_Giorlando
Participant
Participant

The simple answer then is no you can not.  You have to use Dynamo to change a date format. Geessh. And seven years later, still the same.