HCCDate A Custom API for Cpanel Version 0.1.1 beta 11/MAY/2005 © 2002,2005 Juan R. Pozo http://html.conclase.net/cp/scripts/ mailto:jrpozo@conclase.net Mailing list: http://www.conclase.net/mailman/listinfo/cpanel_conclase.net License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Note: a copy of the GNU General Public License is available at: http://html.conclase.net/cp/scripts/license.html Installation 1) Check if the file HCCDate.pm exists in your server inside the /usr/local/cpanel/Cpanel/ directory 2) If it exists and isn't a previous version of this API please contact me. Otherwise, follow steps 3 to 8 3) switch to root user 4) # cd /usr/local/cpanel/Cpanel/ 5) # wget –N http://html.conclase.net/cp/scripts/HCCDate.pm 6) # chown root.root HCCDate.pm 7) # chmod 0644 HCCDate.pm 8) Add the following language variables to your language files: // HCCDate (English) HCCDate_DayShort-0= S HCCDate_DayShort-1= M HCCDate_DayShort-2= T HCCDate_DayShort-3= W HCCDate_DayShort-4=Th HCCDate_DayShort-5= F HCCDate_DayShort-6=Sa HCCDate_DayMid-0=Sun HCCDate_DayMid-1=Mon HCCDate_DayMid-2=Tur HCCDate_DayMid-3=Wed HCCDate_DayMid-4=Thu HCCDate_DayMid-5=Fri HCCDate_DayMid-6=Sat HCCDate_DayLong-0=Sunday HCCDate_DayLong-1=Monday HCCDate_DayLong-2=Tuesday HCCDate_DayLong-3=Wednesday HCCDate_DayLong-4=Thursday HCCDate_DayLong-5=Friday HCCDate_DayLong-6=Saturday HCCDate_MonthMid-1=Jan HCCDate_MonthMid-2=Feb HCCDate_MonthMid-3=Mar HCCDate_MonthMid-4=Apr HCCDate_MonthMid-5=May HCCDate_MonthMid-6=Jun HCCDate_MonthMid-7=Jul HCCDate_MonthMid-8=Aug HCCDate_MonthMid-9=Sep HCCDate_MonthMid-10=Oct HCCDate_MonthMid-11=Nov HCCDate_MonthMid-12=Dec HCCDate_MonthLong-1=January HCCDate_MonthLong-2=February HCCDate_MonthLong-3=March HCCDate_MonthLong-4=April HCCDate_MonthLong-5=May HCCDate_MonthLong-6=June HCCDate_MonthLong-7=July HCCDate_MonthLong-8=August HCCDate_MonthLong-9=September HCCDate_MonthLong-10=October HCCDate_MonthLong-11=November HCCDate_MonthLong-12=December HCCDate_Ord1=st; HCCDate_Ord2=nd; HCCDate_Ord3=rd; HCCDate_OrdX=th; // HCCDate (Spanish) HCCDate_DayShort-0=D HCCDate_DayShort-1=L HCCDate_DayShort-2=M HCCDate_DayShort-3=X HCCDate_DayShort-4=J HCCDate_DayShort-5=V HCCDate_DayShort-6=S HCCDate_DayMid-0=Dom HCCDate_DayMid-1=Lun HCCDate_DayMid-2=Mar HCCDate_DayMid-3=Mié HCCDate_DayMid-4=Jue HCCDate_DayMid-5=Vie HCCDate_DayMid-6=Sáb HCCDate_DayLong-0=Domingo HCCDate_DayLong-1=Lunes HCCDate_DayLong-2=Martes HCCDate_DayLong-3=Miércoles HCCDate_DayLong-4=Jueves HCCDate_DayLong-5=Viernes HCCDate_DayLong-6=Sábado HCCDate_MonthMid-1=Ene HCCDate_MonthMid-2=Feb HCCDate_MonthMid-3=Mar HCCDate_MonthMid-4=Abr HCCDate_MonthMid-5=May HCCDate_MonthMid-6=Jun HCCDate_MonthMid-7=Jul HCCDate_MonthMid-8=Ago HCCDate_MonthMid-9=Sep HCCDate_MonthMid-10=Oct HCCDate_MonthMid-11=Nov HCCDate_MonthMid-12=Dic HCCDate_MonthLong-1=Enero HCCDate_MonthLong-2=Febrero HCCDate_MonthLong-3=Marzo HCCDate_MonthLong-4=Abril HCCDate_MonthLong-5=Mayo HCCDate_MonthLong-6=Junio HCCDate_MonthLong-7=Julio HCCDate_MonthLong-8=Agosto HCCDate_MonthLong-9=Septiembre HCCDate_MonthLong-10=Octubre HCCDate_MonthLong-11=Noviembre HCCDate_MonthLong-12=Diciembre HCCDate_Ord1=º HCCDate_Ord2=º HCCDate_Ord3=º HCCDate_OrdX=º API Reference Prints today's date using the format specified by format. If no parameter is given, returns today's date with the format output by the ctime function (see man ctime), for example: Mon May 20 20:21:37 2002 Valid format specifiers are: Year %y year - 00 to 99 %Y year - 0001 to 9999 Month %m month of year - 01 to 12 %f month of year - " 1" to "12" %b,%h month abbreviation - Jan to Dec %B month name - January to December Day %d day of month - 01 to 31 %e day of month - " 1" to "31" %v weekday abbreviation - " S"," M"," T"," W","Th", " F","Sa" %a weekday abbreviation - Sun to Sat %A weekday name - Sunday to Saturday %w day of week - 1 (Monday) to 7 (Sunday) %E day of month with suffix - 1st, 2nd, 3rd... Hour %H hour - 00 to 23 %k hour - " 0" to "23" %i hour - " 1" to "12" %I hour - 01 to 12 %p am or pm Minute, Second %M minute - 00 to 59 %S second - 00 to 59 Others %+ comma - , %% percent - % For example: would yield something like Mon, 20 May 2002 20:21:37. Notice that displayed day and month names depend on the user's language. Returns the date the account was created, using the format specified by format. If no parameter is given, returns the date the account was created with the format output by the ctime function. See the Today() API call description above for more information on valid format specifiers. Changelog 0.1.1 Beta – 11/MAY/2005 Fixed lang function to account for Cpanel's cachelang mechanism. 0.1 Beta – 20/SEP/2003 Forked from HCCApi 0.3.7. First public release. Please consider making a donation today. Visit my amazon.com wishlist at: http://html.conclase.net/link/wishlist Thank you :)