Saturday 7 March 2015

snLibrary - utils

snLibrary - utils

There are a few utilities that can be used frequently in our codes. These have been packaged into utils package. Some other useful ones are also available under snUploader package as well.

Class: utils.snUtils:-
 num2words() - Convert a numeric (long) value to words in Indian format
 dmy2ymd() - Convert a String in Date format of YYYY-MM-DD into DD-MM-YYYY format
 ymd2dmy() - Convert a String in Date format of DD-MM-YYYY into YYYY-MM-DD format.
 getEncodeUTF8() - URLEncode  the String parameter.

Class: config.snDBFuncLib:-
  getSQLDate() - Gives the current date in YYYY-MM-DD (ie SQL standard format).
  getSQLDateTime() - Gives the current date in YYYY-MM-DD HH24:MI:SS  (ie SQL standard format).
 
Class: utils.snUtilsConstants:-
  getDateTimeNow() - sets Date and Time in two public variables namely : DATE_NOW and TIME_NOW.  The format for Date is DD-MM-YYYY Gives the current date in YYYY.MM.DD and that for time is HH.MM.SS.  (May be converted to required format using dmy2ymd()).



No comments:

Post a Comment