Conversion

Function

Description

uBase64Decode

Decodes a string from a Base64 representation

uBase64Encode

Encodes a string into a Base64 representation

uConvertDate

Converts a date string into the default or a custom date format

uFromHex

Converts Hexadecimal value into Integer value

uToHex

Converts Integer value into hexadecimal digits

uHexDecode

Composes a string from hexadecimal values

uHexEncode

Encodes the characters of a string into hexadecimal notation

uToUnicode

Converts a string into its Unicode representation

uURIDecode

Decodes a string replacing the escape sequences with their original values

uURIEncode

Replaces certain characters in an URI with escape sequences




uBase64Decode

Description

Decodes a string from a Base64 representation

Syntax

string uBase64Decode(input)

Parameters

string input

The string to decode

Examples

Example 1

uBase64Decode("QSBzZWNyZXQ=") // returns "A secret"



uBase64Encode

Description

Encodes a string into a Base64 representation

Syntax

string uBase64Encode(input)

Parameters

string input

The string to encode.

Examples

Example 1

uBase64Encode("A secret") // returns "QSBzZWNyZXQ="



uConvertDate

Description

Converts a date string into the default or a custom date format. The first parameter is the date string to be converted; the second parameter is a format string, specifying the date format of the input date string (see the following table). The outputformat parameter is optional, and if it is omitted, the date is converted in the format y-M-D H:N:S.

The function handles dates from 1582 to present day. If the date cannot be converted, the result string will be empty.

Syntax

string uConvertDate(datestring, inputformat [, outputformat])

Parameters

string datestring

The date string to convert

string inputformat

The date/time format of the input string

string outputformat (optional)

The desired output format. If omitted, the default format is y-M-D H:N:S.

Examples

Example 1

Convert date strings into a different formats

uConvertDate("2005-06-27 00:00:00","y-M-D H:N:S","D mY") // returns "27 JUN 05"
uConvertDate("27 JUN 05", "D m Y") // returns "2005-06-27 00:00:00"

Usage


Description

The function uConvertDate converts a date string into a different format using a source and a destination format string. The first parameter is the date string to be converted. The second parameter is a format string, specifying the date format of the input date (see list below). The outputformat parameter is optional. If omitted the date will be converted using the format y-M-D H:N:S. The function handles dates from 1582 to present day. If the date could not be converted, the result string will be empty.


Identifier Description

Identifier

Description

Y

year 2-digits (06)

y

year 4-digits (2006)

C

century (20)

M

month (03)

m

month (JUN)

D

day (12)

H

hour (00..23)

h

hour (01..12)

N

minutes

S

seconds

s

hundredth of seconds

t

thousandth of seconds

A

AM/PM

d

day of week (5)

D

day of week (Friday)

E

day of year (001..366)

G

week of year (01..52)

F

week of month (1..6)




uFromHex

Description

Converts Hexadecimal value into Integer value

Syntax

integer uFromHex(input)

Parameters

string input

The string to convert

Examples

Example 1

uFromHex("A3F") // returns 2623
uFromHex("B")   // returns 11



uToHex

Description

Converts Integer value into hexadecimal digits

Syntax

string uToHex(input)

Parameters

integer input

The integer value to convert

Examples

Example 1

uToHex(45) // returns "2D"



uHexDecode

Description

Composes a string from hexadecimal values

Syntax

string uHexDecode(input)

Parameters

string input

The hexadecimal string containing the hexadecimal values

Examples

Example 1

Convert a hex value to a string

uHexDecode("313730") // returns "170"
uHexDecode(313730)   // returns "170"



uHexEncode

Description

Encodes the characters of a string into hexadecimal notation

Syntax

string uHexEncode(input)

Parameters

string input

The string to encode

Examples

Example 1

Convert a string to hex values

uHexEncode("170") // returns "313730"
uHexEncode(170)   // returns "313730"



uToUnicode

Description

Converts a string into its Unicode representation

Syntax

string uToUnicode(input)

Parameters

string input

The input string




uURIDecode

Description

Decodes a string replacing the escape sequences with their original values

Syntax

string uURIDecode(uri)

Parameters

string uri

The URI to decode

Examples

Example 1

uURIDecode(“..www.myServer.com/filename%20with%20spaces.txt") // returns 
“..www.myServer.com/filename with spaces.txt"



uURIEncode

Description

Replaces certain characters in an URI with escape sequences

Syntax

string uURIEncode(uri)

Parameters

string uri

The URI to encode

Examples

Example 1

uURIEncode(“..www.myServer.com/filename with spaces.txt")// returns
“..www.myServer.com/filename%20with%20spaces.txt"