Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How-To Date/Time Object in Illustrator/Photoshop

Community Beginner ,
Oct 24, 2018 Oct 24, 2018

Is there a such thing as a date/time object in Illustrator? I make these design plans for my company all the time and they always need to include the date. It'd be awesome if there was a was to insert a little text box that says "CreateDate/Time: Month, day, year" or something like that. Does this already exist and I don't know about it?

 

Thanks!

 

[Moved out of the LiveCycle General discussions forum and into an Illustrator support forum - moderator]

TOPICS
How-to
13.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 24, 2018 Oct 24, 2018

Some plugins can do that.

Such as Tag72a by Worker72a

(only for Mac, you didn't tell us your system)

Translate
Adobe
Community Expert ,
Oct 24, 2018 Oct 24, 2018

Some plugins can do that.

Such as Tag72a by Worker72a

(only for Mac, you didn't tell us your system)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2018 Oct 24, 2018

I'm using a windows computer. I'll see if there's any plugins available for that. Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 24, 2018 Oct 24, 2018

I use Tag72a and cant live withou it, works just greaat

how ever you can use free scripts as well...  (there are various out there)

here is one from Wolfang Rezsel that works, tested here in Illustrator 2019 version on a Mac, I dont know if it works on windows machines, just give it a try and tell us..

WR-DateAndTime [Illustrator Praxis]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2018 Oct 24, 2018

Introducing: Insert Page Numbers v 2

CarlosCanto wrote the one above for Illustrator, still works for me in CC2018/high sierra.

if your final product is PDF

Create a custom dynamic stamp using Acrobat DC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2018 Oct 24, 2018

We're close. I'm being picky I know, but the format is off. It's written as 10/24/2018 instead of October 24th, 2018. I might try writing my own script if I can understand what he wrote. On second thought, if it's really this complicated it's not even worth messing with. I'll just change the 23 to a 24 and be done with it. I thought it would be something as simple as excel or something similar where you can just put in "=(TODAY)" and be done with it.

**hint hint** future development option adobe!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 24, 2018 Oct 24, 2018

Ryan

I tested the script  at home wich is windows with illustrator 2018 and it worked great, same as in Mac, so please give a try.

here you can see a very detailed tutorial on how to use it..

Illustrator Script to add a Date and Time to your file » Blog » FashionClassroom.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2020 Jun 11, 2020

The link is gone.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 12, 2020 Jun 12, 2020

I found this handy function to get the current time in full datetime string. There are other functions of the date object to get the year, month, date, hour, minute, second, and milisecond. You also have a full set of 'set' functions.

new Date().toLocaleString()

the result looks something like: Friday, June 12 2020 15:18:41

I could not find a formal description of this date object, but I found 45 functions available using the object.reflect property. Here is my listMethods() code.

function listMethods(anObj) {

// list the methods of given object to the console
// this is needrf as I suspect the documentation may not be complete
    var mets = anObj.reflect.methods;
    $.writeln('There are ' + mets.length + ' methods');
    for (var i=0; i<mets.length; i++) {
        $.writeln(i + ". " + mets[i].name + "=[" + anObj[mets[i].name] + "]");
        };
    return null;

    };

I am running Illustrator 2020 CS6.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 24, 2020 Jun 24, 2020

I noticed that the above links are all gone. Here is what I just found, for anyone looking for dateandtimes script and landed here.
http://illustrator.hilfdirselbst.ch/dokuwiki/_media/english/scripts/javascript/wolfgangreszel/wr-dat...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2023 Dec 21, 2023

Your link is gone 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2024 Aug 22, 2024

The link is gone.. 404 not found

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 20, 2024 Oct 20, 2024
LATEST

I've made a script with chat GPT. It updates all text frames in Illustrator document that match any of the specified date formats to the current date, keeping the format the same as the input. It now handles the formats "DD.MM.YYYY", "YYYY.MM.DD", "YYYY-MM-DD", "DD-MM-YYYY", "DD/MM/YYYY", "YYYY/MM/DD", and "MM/DD/YYYY".  You can copy it to notepad, save as txt, then rename to jsx file extension and run in AI.

 

// Function to get the current date as a string in the specified format
function getCurrentDateString(format) {
var currentDate = new Date();
var day = ("0" + currentDate.getDate()).slice(-2);
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
var year = currentDate.getFullYear();
switch (format) {
case "DD.MM.YYYY":
return day + "." + month + "." + year;
case "YYYY.MM.DD":
return year + "." + month + "." + day;
case "YYYY-MM-DD":
return year + "-" + month + "-" + day;
case "DD-MM-YYYY":
return day + "-" + month + "-" + year;
case "DD/MM/YYYY":
return day + "/" + month + "/" + year;
case "YYYY/MM/DD":
return year + "/" + month + "/" + day;
default:
return day + "." + month + "." + year; // Default to "DD.MM.YYYY"
}
}

// Function to update all text frames containing dates to the current date
function updateDateTextFrames(doc) {
var textFrames = doc.textFrames;
// Regular expressions to match different date formats
var datePatterns = [
{ pattern: /^\d{2}\.\d{2}\.\d{4}$/, format: "DD.MM.YYYY" }, // Match date format like "18.10.2024"
{ pattern: /^\d{4}\.\d{2}\.\d{2}$/, format: "YYYY.MM.DD" }, // Match date format like "2024.10.18"
{ pattern: /^\d{4}-\d{2}-\d{2}$/, format: "YYYY-MM-DD" }, // Match date format like "2024-10-18"
{ pattern: /^\d{2}-\d{2}-\d{4}$/, format: "DD-MM-YYYY" }, // Match date format like "18-10-2024"
{ pattern: /^\d{2}\/\d{2}\/\d{4}$/, format: "DD/MM/YYYY" }, // Match date format like "18/10/2024"
{ pattern: /^\d{4}\/\d{2}\/\d{2}$/, format: "YYYY/MM/DD" } // Match date format like "2024/10/18"
];
for (var i = 0; i < textFrames.length; i++) {
var textFrame = textFrames[i];
for (var j = 0; j < datePatterns.length; j++) {
if (textFrame.contents.match(datePatterns[j].pattern)) {
var newDateString = getCurrentDateString(datePatterns[j].format);
textFrame.contents = newDateString;
break; // Exit the loop once a match is found and updated
}
}
}
}

// Main script execution
if (app.documents.length > 0) {
var doc = app.activeDocument;
// Update all previously created text frames containing dates to the current date
updateDateTextFrames(doc);
alert("Date text frames updated to the current date.");
} else {
alert("No document is open.");
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines