The accurate description of van der Waals forces within density functional theory is currently one of the most active areas of research in computational physics and chemistry. Here we report results on the structural and energetic properties of graphite and hexagonal boron nitride, two layered materials where interlayer binding is dominated by van der Waals forces. Results from several density functionals are reported, including the optimized Becke88 van der Waals (optB88-vdW) and the optimized PBE van der Waals (optPBE-vdW) (Klimeš et al 2010 J. Phys.: Condens. Matter 22 022201) functionals. Where comparison to experiment and higher-level theory is possible, the results obtained from the two new van der Waals density functionals are in good agreement. An analysis of the physical nature of the interlayer binding in both graphite and hexagonal boron nitride is also reported.