# No epoch or seconds in windows facts ? How can i generate unique strings ?

**URL:** <https://forum.ansible.com/t/no-epoch-or-seconds-in-windows-facts-how-can-i-generate-unique-strings/22147>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 28, 2016, 1:13pm UTC](https://forum.ansible.com/t/no-epoch-or-seconds-in-windows-facts-how-can-i-generate-unique-strings/22147 "2016-07-28T13:13:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ishan\_jain](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Post date:** [July 28, 2016, 1:13pm UTC](https://forum.ansible.com/t/no-epoch-or-seconds-in-windows-facts-how-can-i-generate-unique-strings/22147/1 "2016-07-28T13:13:12Z")

</div>

Here is a small part of windows facts:

“ansible\_facts”: {  
“ansible\_architecture”: “64-bit”,  
“ansible\_date\_time”: {  
“date”: “13.07.2016”,  
“day”: “13”,  
“hour”: “06”,  
“iso8601”: “2016-07-13T06:34:29”,  
“minute”: “34”,  
“month”: “07”,  
“year”: “2016”  
},

Unlike facts for linux hosts, this does not have epoch or even seconds info ? This is a bit strange for me. Is there a way i can force it to collect that ?

What i am trying is to check if the current user has read/write access on certain drive. I was trying to create a file with unique name on the location and for that i need some sort of unique string.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [July 29, 2016, 8:04pm UTC](https://forum.ansible.com/t/no-epoch-or-seconds-in-windows-facts-how-can-i-generate-unique-strings/22147/2 "2016-07-29T20:04:29Z")

</div>

Seconds are at the end of the iso8601 string. I use the iso8601 for one playbook where I need a unique string on volume snapshots.

---

<div class="post-metadata">

**Author:** ![ishan\_jain](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Post date:** [August 1, 2016, 6:11am UTC](https://forum.ansible.com/t/no-epoch-or-seconds-in-windows-facts-how-can-i-generate-unique-strings/22147/3 "2016-08-01T06:11:59Z")

</div>

I used a windows command to get the date:

get-date -format dd-MM-yyyy\_HH\_mm\_ss\_fff

So, to make a unique folder in windows, use:

mkdir $(get-date -format dd-MM-yyyy\_HH\_mm\_ss\_fff)
