Skip to main content
Glama
get-current-date.ts1.19 kB
import { Property, createAction } from '@activepieces/pieces-framework'; import { optionalTimeFormats, timeFormat, timeFormatDescription, timeZoneOptions, getCorrectedFormat, apDayjs } from '../common'; export const getCurrentDate = createAction({ name: 'get_current_date', displayName: 'Get Current Date', description: 'Get the current date', errorHandlingOptions: { continueOnFailure: { hide: true, }, retryOnFailure: { hide: true, }, }, props: { timeFormat: Property.StaticDropdown({ displayName: 'To Time Format', description: timeFormatDescription, options: { options: optionalTimeFormats, }, required: true, defaultValue: timeFormat.format00, }), timeZone: Property.StaticDropdown<string>({ displayName: 'Time Zone', options: { options: timeZoneOptions, }, required: true, defaultValue: 'UTC', }), }, async run(context) { const timeFormat = getCorrectedFormat(context.propsValue.timeFormat); const timeZone = context.propsValue.timeZone; return { result: apDayjs().tz(timeZone).format(timeFormat) }; }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server