Documentation

Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited

Print

Converting Text to DateTimeOffset Format

Pause to DateTimeOffset

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>jsonValue</variable></variables><block type=\"DateTime_parseDateTimeOffset\" disabled=\"true\" x=\"-22\" y=\"112\"><value name=\"s\"><shadow type=\"text\" disabled=\"true\"><field name=\"TEXT\"/></shadow></value></block></xml>"}
				
			

This block is used to analyze the text into DateTimeOffset. 

Parameters: String

Output: DateTimeOffset

Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>dateTimeOffset</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\">dateTimeOffset</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"DateTime_parseDateTimeOffset\"><value name=\"s\"><shadow type=\"text\"><field name=\"TEXT\">2022-08-16</field></shadow></value></block></value><next><block type=\"basic_consoleLogText\"><value name=\"text\"><block type=\"DateTime_DateTimeOffset_toString\"><value name=\"dateTimeOffset\"><block type=\"variables_get\"><field name=\"VAR\">dateTimeOffset</field></block></value></block></value></block></next></block></statement></block></xml>"}
				
			

The output:

Pause to datetimeoffset - Output
Next Generate a DateTimeOffset with Different Unit