在数据库的运用过程中,我们时常会碰到根据身份证号码来获取当前的年龄,今天我在这里写了一个函数,就是关于获取年龄的 create or replace function FUNC_COMPARE_SFZHM( sfzhm in varchar2) --输入身份证号码 return number /* 函数说明,返回值0为小于18岁:值为1是大于75岁:其他情况是返回值为2 在这个函数里用到了trunc(months_between()) 然后就是将身份证号码里的年月日组合成'yyyy-mm-dd'
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <t
项目要用到这个功能,就写了一个,完整类也就二百来行,很简单.可以在项目中用,也可以作为学习. 源码下载 http://yunpan.cn/cmQCSWkhDnZLJ 访问密码 0227 核心代码如下: using System; using System.Collections.Generic; using System.Collections; using System.Text; using System.Xml; using System.Text.RegularExpressions;
1.银行卡卡号校验方法. function luhnCheck(bankno) { var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhn进行比较) var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位 var newArr = new Array(); for (var i = first15Num.length - 1; i > -1; i--
package xidian.sl.netcredit.util; /** * Copyright (C) 2009-2010 Yichuan, Fuchun All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this wo