DateTime Tools for Langflow logo

DateTime Tools for Langflow

by natapone

A simple custom component for Langflow that provides datetime-related tools with timezone support. It allows you to get the current date and time or week number for a specified timezone.

View on GitHub

Last updated: N/A

What is DateTime Tools for Langflow?

This is a custom component for Langflow that provides datetime-related tools, allowing users to easily retrieve the current date and time or week number for a given timezone.

How to use DateTime Tools for Langflow?

To use this component, copy the code from langflow_component.py, open Langflow, click '+ Custom Component', paste the code, and click 'Check & Save'. Then, you can use the get_current_datetime and get_week_number methods with a timezone string as input.

Key features of DateTime Tools for Langflow

  • Get current date and time with timezone support

  • Get current week number with timezone support

  • Simple error handling for invalid timezones

  • Supports IANA Time Zone Database

Use cases of DateTime Tools for Langflow

  • Displaying current time in different timezones

  • Scheduling tasks based on week number

  • Timezone-aware application development

  • Integrating time-related functionalities into Langflow workflows

FAQ from DateTime Tools for Langflow

What timezones are supported?

The component supports all timezones available in the IANA Time Zone Database.

What happens if I provide an invalid timezone?

The component will return an error message.

What dependencies are required?

The component requires the pytz package and the built-in datetime module.

How do I install the component?

Copy the code into Langflow's custom component editor and save it.

What does get_week_number return on error?

Week number will return -1 for invalid timezones or errors