on24 Webinar - show correct time zone/ date for customer country

Harry_Rashid
Level 3

on24 Webinar - show correct time zone/ date for customer country

Hi,

I'm trying to show correct country time and date for an on24 Webinar. I have a custom object which I am pulling data from eventdatetime field which the date shows UK time Apr 23, 2021 2:00 PM, I am trying to show different Time/Date for other locales/Countries depending where the customer is from, so if customer is from Germany the output should show Apr 23, 2021 3:00 PM as Germany is an hour ahead, this needs to be replicated for all countries as we have customers across the globe. 

 

So far I only have the following code, any help would be amazing. Thanks

 

#set( $defaultTimeZone = $date.getTimeZone().getTimeZone("Europe/London") )
#set( $defaultLocale = $date.getLocale() )
#set( $calNow = $date.getCalendar() )
#set( $ret = $calNow.setTimeZone($defaultTimeZone) )
#set( $calConst = $field.in($calNow) )
#set( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )

  ## Check if the Custom object ID and pull date in
  #foreach( $attendee in $oN24Attendee_cList )
  #if($attendee.eventid == 3091278)
  
   #set( $eventdatetimelike = $attendee.eventdatetime )

        #set( $eventdatetime = $convert.parseDate(

        $eventdatetimelike,

        $dateOptions.formats.userin,

        $dateOptions.locale,

        $date.getTimeZone().getTimeZone($dateOptions.timezones.userin)

        ) )
        
        #set( $eventdatetime_formatted = $date.format(

        $dateOptions.formats.userout,

        $eventdatetime,

        $dateOptions.locale,

        $date.getTimeZone().getTimeZone($dateOptions.timezones.userout)
        
        ) )
        
    
#if(${lead.Marketo_eShot_Dynamic__c} == "Belgium")

$eventdatetime_formatted

##$date.format('dd-MM-yyyy', ${convert.parseDate(${attendee.eventdatetime}, 'yyyy-MM-dd HH:mm:ss')}) 
 
## Check if the Country is Netherlands
#elseif(${lead.Marketo_eShot_Dynamic__c} == "Netherlands")

$eventdatetime_formatted
## Display the date as dd.mm.yyyy
##$date.format('dd.MM.yyyy', ${convert.parseDate(${attendee.eventdatetime}, 'yyyy-MM-dd HH:mm:ss')}) 

#elseif(${lead.Marketo_eShot_Dynamic__c} == "UK")
## Display the date as dd.mm.yyyy

$eventdatetime_formatted
$date.format('dd.MM.yyyy', ${convert.parseDate(${attendee.eventdatetime}, 'yyyy-MM-dd')}) 

#elseif(${lead.Marketo_eShot_Dynamic__c} == "Germany")
## Display the date as dd.mm.yyyy
<br>
$eventdatetime_formatted
##$date.format('dd.MM.yyyy', ${convert.parseDate(${attendee.eventdatetime}, 'yyyy-MM-dd')}) 

## If Country equals anything else or if the Country is empty display the date in the regular default format
#else
${attendee.eventdatetime}
#end #end #end