Skip to main content
Solved

Get local file last modified date

  • July 30, 2025
  • 10 replies
  • 193 views

Forum|alt.badge.img+1

Hi team, 

 

I am new to A360 and is trying to play around with it.

 

I am implementing a triggering email based on the local file date modified (last modified date). An email should be triggered to a person when Today() is 5 months after the last modified date.

But I am struggling on how to get the file’s last modified date. 

Once I could get the last modified date, I could do the calculation to subtract Today with Last modified date and store it inside a variable to be used at the condition, to trigger the email. 

 

However, I am stuck here.

 

Appreciate if anyone could help me figure out how and how can I move forward.

 

Thank you and have a great day ahead.

Best answer by Aaron.Gleason

@nisnisss ​@Padmakumar You would need to have your control room administrator add the File IO Utilities package to your control room.

https://botstore.automationanywhere.com/bot/file-io-utilities-package

My Python script returned the file creation date specifically here:

https://community.automationanywhere.com/developers-forum-36/file-created-date-86012?postid=98038#post98038 

To modify it to report the last modified date, the code would be:

import os, time
def getFileModifiedDate(filePath):
mtime = os.path.getmtime(filePath)
return time.ctime(mtime)

Hope that helps!

10 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • July 30, 2025

The File Utils package on the Bot Store can help you with the last modified date. Python script can, too, and I have an example that I posted on this board a while ago.

https://botstore.automationanywhere.com/bot/file-io-utilities-package

 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • July 30, 2025

@Aaron.Gleason 

Hi Aaron, thank you for responding!

 

I was wondering if it is possible to use File attributes instead? Because I am implementing this bot using my company’s A360 account, not sure if I could easily install the bot store.


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • July 31, 2025

Hi ​@Aaron.Gleason ,

 

Thank you for responding. 

 

Fyi, I am using my company’s account to implement this. This is for my self-training. 

 

is there any other way that I could use? Like, maybe File attributes? And you say Python script can help, do you mind elaborating this?

 

Thank you and have a great day ahead!


Forum|alt.badge.img+4
  • Navigator | Tier 3
  • July 31, 2025

Hi team, 

 

I am new to A360 and is trying to play around with it.

 

I am implementing a triggering email based on the local file date modified (last modified date). An email should be triggered to a person when Today() is 5 months after the last modified date.

But I am struggling on how to get the file’s last modified date. 

Once I could get the last modified date, I could do the calculation to subtract Today with Last modified date and store it inside a variable to be used at the condition, to trigger the email. 

 

However, I am stuck here.

 

Appreciate if anyone could help me figure out how and how can I move forward.

 

Thank you and have a great day ahead.

 

  • Try Below points

  • Drag the “Get file information” action into your bot.

  • Provide the full file path (e.g., C:\Reports\sales.xlsx).

  • Assign the output to a dictionary variable.

  • Extract the lastModifiedDate from the dictionary.


Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • July 31, 2025

Hi team, 

 

I am new to A360 and is trying to play around with it.

 

I am implementing a triggering email based on the local file date modified (last modified date). An email should be triggered to a person when Today() is 5 months after the last modified date.

But I am struggling on how to get the file’s last modified date. 

Once I could get the last modified date, I could do the calculation to subtract Today with Last modified date and store it inside a variable to be used at the condition, to trigger the email. 

 

However, I am stuck here.

 

Appreciate if anyone could help me figure out how and how can I move forward.

 

Thank you and have a great day ahead.

 

  • Try Below points

  • Drag the “Get file information” action into your bot.

  • Provide the full file path (e.g., C:\Reports\sales.xlsx).

  • Assign the output to a dictionary variable.

  • Extract the lastModifiedDate from the dictionary.

 

Correction. Just Modified would be enough.

 

Note: This is regarding the File-IO utilities and not the File package.


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • August 1, 2025

Hi ​@Padmakumar ,

 

I couldn’t find any Modified action from the action list. Can you guide me through?


Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • August 1, 2025

Hi ​@Padmakumar ,

 

I couldn’t find any Modified action from the action list. Can you guide me through?

 

It is not an action. The output of the File Properties action of the File-IO Utilities is a dictionary variable. The key Modified is used to retrieve the last modified date from that dictionary variable.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • September 15, 2025

@nisnisss ​@Padmakumar You would need to have your control room administrator add the File IO Utilities package to your control room.

https://botstore.automationanywhere.com/bot/file-io-utilities-package

My Python script returned the file creation date specifically here:

https://community.automationanywhere.com/developers-forum-36/file-created-date-86012?postid=98038#post98038 

To modify it to report the last modified date, the code would be:

import os, time
def getFileModifiedDate(filePath):
mtime = os.path.getmtime(filePath)
return time.ctime(mtime)

Hope that helps!


Pravin 3017
Forum|alt.badge.img+3
  • Navigator | Tier 3
  • September 16, 2025

if file-io-utilities-package Package and Any Scripting is blocked in your organization, then you can create dll to get the file modified date.


Shreya.Kumar
Pathfinder Community Team
Forum|alt.badge.img+14
  • Pathfinder Community Team
  • October 7, 2025

@nisniss I’m curious to know more about this use case! Is there a specific reason you went with 5 months? Also, how would you design your process to handle file modifications after the bot is scheduled?