Function |
Description |
---|---|
Decodes a string from a Base64 representation |
|
Encodes a string into a Base64 representation |
|
Converts a date string into the default or a custom date format |
|
Converts a hexadecimal value into an integer value |
|
Converts an integer value into a hexadecimal digit |
|
Composes a string from hexadecimal values |
|
Encodes the characters of a string into hexadecimal notation |
|
Converts a string into its Unicode representation |
|
Decodes a string, replacing escape sequences with their original values |
|
Replaces certain characters in a URI with escape sequences |
Decodes a string from a Base64 representation
string uBase64Decode(input)
The string to decode
uBase64Decode("QSBzZWNyZXQ=") // returns "A secret"
Encodes a string into a Base64 representation
string uBase64Encode(input)
The string to encode.
uBase64Encode("A secret") // returns "QSBzZWNyZXQ="
Converts a date string into the default or a custom date format.
The function handles dates from 1582 to present day. If the date cannot be converted, the result string is empty.
string uConvertDate(datestring, inputformat [, outputformat])
The date string to convert
The date/time format of the input string
The desired output format. If omitted, the default
format is y-M-D H:N:S
.
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"
Sybase recommends you to provide input data for all the fields required in the output data. Having fields in the output data for which no input data has been provided, can lead to unexpected results. For example, if you require hours, minutes, and seconds fields in the output data, your input data should be something similar to this:
uConvertDate("27 JUN 05", "D m Y", "y-m-D 00:00:00") // returns "2005-06-27 00:00:00"
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 is converted using 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
is empty.
Identifier |
Description |
---|---|
Y |
Year 2-digits (06) |
y |
Year 4-digits (2006) |
|
Century (20) |
|
Month (03) |
|
Month (JUN) |
|
Day (12) |
|
Hour (00 – 23) |
|
Hour (01 – 12) |
|
Minutes |
|
Month (June) |
|
Seconds |
|
Hundredth of seconds |
|
Thousandth of seconds |
|
AM/PM |
|
Day of month (05) |
|
Day of year (001 – 366) |
|
Week of year (01 – 52) |
|
Week of month (1 – 6) |
Converts a hexadecimal value into an integer value
integer uFromHex(input)
The string to convert:
uFromHex("A3F") // returns 2623
uFromHex("B") // returns 11
Converts an integer value into a hexadecimal value
string uToHex(input)
The integer value to convert:
uToHex(45) // returns "2D"
Composes a string from hexadecimal values
string uHexDecode(input)
The hexadecimal string containing the hexadecimal values
Convert a hexadecimal value to a string:
uHexDecode("313730") // returns "170"
uHexDecode(313730) // returns "170"
Encodes the characters of a string into hexadecimal notation
string uHexEncode(input)
The string to encode
Convert a string to hexadecimal values:
uHexEncode("170") // returns "313730"
uHexEncode(170) // returns "313730"
Converts a string into its Unicode representation
string uToUnicode(input)
The input string
Decodes a string, replacing escape sequences with their original values
string uURIDecode(uri)
The URI to decode
uURIDecode(“..www.myServer.com/filename%20with%20spaces.txt") // returns “..www.myServer.com/filename with spaces.txt"
Replaces certain characters in a URI with escape sequences
string uURIEncode(uri)
The URI to encode
uURIEncode(“..www.myServer.com/filename with spaces.txt")// returns “..www.myServer.com/filename%20with%20spaces.txt"