# system.print.printToImage with date name

**URL:** <https://forum.inductiveautomation.com/t/system-print-printtoimage-with-date-name/10052>\
**Category:** Ignition\
**Created:** [May 23, 2015, 2:38pm UTC](https://forum.inductiveautomation.com/t/system-print-printtoimage-with-date-name/10052 "2015-05-23T14:38:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoisesZV](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@MoisesZV](https://forum.inductiveautomation.com/u/MoisesZV)\
**Post date:** [May 23, 2015, 2:38pm UTC](https://forum.inductiveautomation.com/t/system-print-printtoimage-with-date-name/10052/1 "2015-05-23T14:38:46Z")

</div>

Hi, I have this code in a button and I’m trying to give the image a name using the currentdatetime tag, but I don’t know how to put it correctly.

```auto
Date = system.tag.getTagValue("[System]Gateway/CurrentDateTime") 
system.print.printToImage(event.source.parent, "Date + '.jpg'")

```

---

<div class="post-metadata">

**Author:** ![Chris\_Taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_taylor/32/3315_2.png) [@Chris\_Taylor](https://forum.inductiveautomation.com/u/Chris_Taylor)\
**Post date:** [May 24, 2015, 11:18am UTC](https://forum.inductiveautomation.com/t/system-print-printtoimage-with-date-name/10052/2 "2015-05-24T11:18:57Z")

</div>

Hi MoisesZV

try

`Date = str(system.tag.getTagValue("[System]Gateway/CurrentDateTime"))
Date = Date.replace(":"," ")
system.print.printToImage(event.source.parent, Date + '.jpg')`

first I turned the date into a string,  
then removed the “:” as they won’t be liked in a file name.  
then removed the “” around Date as its a string already.
