My project timezone is set to GMT. How can I use custom event properties to create a custom property that adjusts Time data for another timezone e.g. EST?
Hi Lois, Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To create a custom property that adjusts time data from GMT to EST using Mixpanel's custom event properties, you can use the following approach:1. First, create a new custom property using the property builder in Mixpanel.2. In the formula bar, you can use the DATETIME_ADD
function to adjust the time. EST is typically 5 hours behind GMT, so you would subtract 5 hours from the GMT time.Here's an example of how you might structure the formula:LBKSDATETIME_ADD(DATETIME(time), -5, "hours")LBKS
This formula takes the original time
property, converts it to a datetime object, and then subtracts 5 hours to adjust from GMT to EST.Remember that this adjustment doesn't account for daylight saving time changes, so you may need to adjust the hour difference accordingly during different parts of the year.For more detailed instructions on creating custom properties, you can refer to the Custom Properties documentation.It's important to note that while this method allows you to create a custom property with adjusted time, it doesn't change the underlying project timezone. The project timezone setting affects how Mixpanel interprets and stores event timestamps. If you need to change the project timezone itself, that would be a separate process handled in the project settings.Managing Projects documentation provides more information on how Mixpanel handles timezones and how to manage them for your project.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
I apologize for the confusion in my previous response. You are correct that DATETIME_ADD()
is not a standard function in Mixpanel's custom property formulas. I made a mistake in suggesting that function. Let me provide a more accurate answer based on the available Mixpanel documentation.Mixpanel's custom property formulas have a limited set of functions and operators available. According to the Custom Properties documentation, the basic numeric operators available are:- +
: Addition
- -
: Subtraction
- *
: Multiplication
- /
: Division
- %
: ModuloUnfortunately, there isn't a built-in function specifically for datetime manipulation in the custom property formulas based on the provided knowledge sources.To adjust time data for a different timezone, you might need to consider alternative approaches:1. If possible, adjust the timezone at the project level as described in the Managing Projects documentation.2. If you need to work with multiple timezones within the same project, you may need to handle the timezone conversion at the data ingestion stage before sending events to Mixpanel.3. For more complex time-based calculations or timezone adjustments, you might need to use Mixpanel's data export features and perform the calculations in your own data warehouse or analysis tool.I apologize again for the incorrect information in my previous response. If you need more specific guidance on working with timezones in Mixpanel, I recommend reaching out to Mixpanel's support team for the most up-to-date and accurate information on handling timezone conversions within their platform.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
Yes, you can use the datedif
function in Mixpanel's custom properties. According to the Custom Properties documentation, the datedif
function is available for date calculations.Here's how you can use it:LBKSdatedif(start_date, end_date, unit)LBKS
Where:
- start_date
is the earlier date
- end_date
is the later date
- unit
is the unit of time you want to calculate the difference inThe unit
parameter can be one of the following:
- "D" for days
- "M" for months
- "Y" for years
- "MD" for days remaining after subtracting whole months
- "YM" for months remaining after subtracting whole years
- "YD" for days, assuming start_date and end_date are within 1 yearYou can also use TODAY()
as the end_date to calculate the difference from a date to the current day.For example, if you wanted to calculate the number of months between a user's registration date and today, you could use:LBKSdatedif(registrationdate, TODAY(), "M")LBKS
This function could be useful for creating a custom property that shows how long a user has been registered, or for other time-based calculations within your Mixpanel project.Remember that while this function allows for some date calculations, it doesn't directly solve the timezone conversion issue we discussed earlier. For specific timezone conversions, you may still need to consider the alternative approaches mentioned in the previous response.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.