朋友谈及身份证相关的信息,才了解到原来省份证号码中包含了年龄和性别. 这样在数据库中,就不必单独留字段存放它们了(不过,要根据具体情况来,要是读取频率较高,还是单独列出为好),这样顺带解决了年龄变更的问题. 程序仅仅为了实现这个功能,里面还是需要数据验证的,用户输入的信息,毕竟在猿类看来,都是“非法的”.废话不多说了,贴上我写的程序,还请路过的大神斧正: using System; using System.Collections.Generic; using System.Linq; usin…
可以用pg自带函数select extract(dow from current_date),之所以没用主要是展示一下通过数学方法计算日期的原理. drop function if exists getDateWeek(date);drop function if exists intervalDay(date);drop function if exists getMonMaxDay(integer,integer);drop function if exists getMonMaxDate(…