Skip to main content
Glama

mcp-google-sheets

get-current-date.ts1.41 kB
import { Property, createAction } from '@activepieces/pieces-framework'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; import advancedFormat from 'dayjs/plugin/advancedFormat'; import { optionalTimeFormats, timeFormat, timeFormatDescription, timeZoneOptions, getCorrectedFormat } from '../common'; dayjs.extend(utc); dayjs.extend(timezone); dayjs.extend(advancedFormat); 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: dayjs().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