Thanks! That worked; what I did was make a text object where I used a clock to fetch the year in VL and then formatted that to display as YYYY to the text of that object. I then positioned that aligned left and added the script above to the date source aligned right.
I made one adjustment: I added this to the visual basic script to convert the date to drop any leading 0s:
Original Message:
Sent: 08-08-2023 09:18
From: Simon Redmile
Subject: Formatting Date & Time
You'll need a source for year, in my case I just made a textbox called "Year" where I wrote the year but you could tie that to VL or to a widget with just YYYY.
Then use this script on your text object instead;
dim day, month, year as string
dim yrText as xpTextObject
Scene.GetObjectByName("Year", yrText)
month = split(text, " ")(2)
day = split(text, " ")(1)
year = yrText.Text
Select Case month
Case "Jan"
month = "January"
Case "Feb"
month = "February"
Case "Mar"
month = "March"
Case "Apr"
month = "April"
Case "May"
month = "May"
Case "Jun"
month = "June"
Case "Jul"
month = "July"
Case "Aug"
month = "August"
Case "Sep"
month = "September"
Case "Oct"
month = "October"
Case "Nov"
month = "November"
Case "Dec"
month = "December"
End Select
text = month & " " & day & "," & " " & year
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 08-08-2023 09:15
From: Simon Redmile
Subject: Formatting Date & Time
oh my bad that would actually display this;
August 02,Tue
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 08-08-2023 09:13
From: Simon Redmile
Subject: Formatting Date & Time
I'm sure someone has a better way than this but if you put this onSetText on the text object that's tied to the date field it will display how you want.
dim day, month, year as string
month = split(text, " ")(2)
day = split(text, " ")(1)
year = split(text, " ")(0)
Select Case month
Case "Jan"
month = "January"
Case "Feb"
month = "February"
Case "Mar"
month = "March"
Case "Apr"
month = "April"
Case "May"
month = "May"
Case "Jun"
month = "June"
Case "Jul"
month = "July"
Case "Aug"
month = "August"
Case "Sep"
month = "September"
Case "Oct"
month = "October"
Case "Nov"
month = "November"
Case "Dec"
month = "December"
End Select
text = month & " " & day & "," & year
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 08-08-2023 07:21
From: Steve Trauger
Subject: Formatting Date & Time
Correct; I'd like to change it so it's August 2, 2023 instead.
------------------------------
Steve Trauger
Original Message:
Sent: 08-08-2023 04:53
From: Simon Redmile
Subject: Formatting Date & Time
so its how does the data you are getting look? "Tue 02 Aug"
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 08-07-2023 17:13
From: Steve Trauger
Subject: Formatting Date & Time
Hello,
I have a DataLinq source (date) that's coming in as ddd, DD MMM. I'd like to reformat it so it's the MMMM D, YYYY. What's the best way to achieve this? I am assuming using Visual Logic but I didn't have luck with getting it to update after creating the following function block order: DatalLinq > Encode Date Time > Format Date Time > Text
How would you advise I achieve this?
------------------------------
Steve Trauger
------------------------------